MyTetra Share
Делитесь знаниями!
Обновление
Время создания: 24.09.2020 14:02
Раздел: INFO - Development - DATABASE - postgres
Запись: wwwlir/Tetra/master/base/16009273361c8tq6zp1v/text.html на raw.githubusercontent.com

select count(c) from public.rtneo_contragent_real_estate c join public.rtneo_real_estate r on c.real_estate_id = r.id

where c.category_id is null and c.type_id is null and c.delete_ts is null and r.name = 'Земельный участок';


update public.rtneo_contragent_real_estate c

set category_id = (select ct.id from public.rtneo_real_estate_category ct where ct.name = 'Исключить из расчета')

from public.rtneo_real_estate r

where c.real_estate_id = r.id

and c.category_id is null

and c.type_id is null

and c.delete_ts is null

and r.name = 'Земельный участок';



update public.rtneo_contragent_real_estate c

set category_id = (select ct.id from public.rtneo_real_estate_category ct where ct.name = 'Исключить из расчета')

from public.rtneo_real_estate r, public.rtneo_real_estate_type t

where c.real_estate_id = r.id and c.type_id = t.id

and c.category_id is null

and t.is_living is null

and c.delete_ts is null

and r.name = 'Земельный участок';


update public.rtneo_contragent_real_estate c

set category_id = (select ct.id from public.rtneo_real_estate_category ct where ct.name = 'Исключить из расчета'),

type_id = (select type.id from public.rtneo_real_estate_type type where type.id = 'b468fb60-2363-b06b-6e80-0f0e77ff383c')

from public.rtneo_real_estate r

where c.real_estate_id = r.id

and c.category_id is null

and c.type_id is null

and c.delete_ts is null

and r.name = 'Земельный участок';


update public.rtneo_contragent_real_estate c

set type_id = (select type.id from public.rtneo_real_estate_type type where type.id = 'b468fb60-2363-b06b-6e80-0f0e77ff383c')

from public.rtneo_real_estate r

where c.real_estate_id = r.id

and c.delete_ts is null

and r.name = 'Земельный участок';

Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования