Advertisement
GLASHATAY_007

municip_customers

Jun 27th, 2024
672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select
  2.         o.inn,
  3.         o.kpp,
  4.         o.ogrn,
  5.         o.fullname--, u.username, concat_ws(' ',u.lastname, u.firstname, u.middlename) as name
  6.         ,o.registrationdate
  7.     from organization As o
  8.     Inner join organizationmember As om On o.id = om.organization_id
  9.     Inner join nsi_okopf n On n.id = o.legalformid And n.id In (175,174,173)
  10.     -- left join users u on om.userid = u.id and u.active = False
  11.     Where 1=1
  12.      And actual_id Is Null
  13.      And registrationstatusid Is Null
  14.      And external_customer = True
  15.     --and o.id in (select organization_id from organizationmember where id in (select memberid from organizationmemberrole where roleid = 44) group by organization_id)
  16. Order by 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement