Advertisement
Guest User

Untitled

a guest
Sep 17th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT *
  2. FROM campaign c
  3. INNER JOIN campaign_relation cr on c.id = cr.campaign_id
  4. INNER JOIN user_account ua on cr.user_account_id = ua.id
  5. INNER JOIN user_profile up on ua.id = up.user_account_id where cr.user_role='owner'
  6. and to_tsvector('english', coalesce(c.description, '') || ' ' ||  coalesce(c.name, '') || ' ' || coalesce(up.first_name, '') || ' ' || coalesce(up.last_name, ''))
  7. @@ to_tsquery('english', '%s');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement