Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT 1
- FROM transaction_contacts_view tcv
- LEFT JOIN contacts c ON c.id = tcv.contact_id
- --LEFT JOIN addresses a ON a.id = tcv.address_id
- WHERE
- (
- c.name ILIKE '%'||'sprint'||'%'
- OR c.first_name ILIKE '%'||'sprint'||'%'
- OR c.last_name ILIKE '%'||'sprint'||'%'
- OR c.company ILIKE '%'||'sprint'||'%'
- --OR a.address1 || ' ' || a.address2 ILIKE '%'||'sprint'||'%'
- --OR a.city || ', ' || a.code ILIKE '%'||'sprint'||'%'
- --OR a.county ILIKE '%'||'sprint'||'%'
- )
- UNION
- SELECT 1
- FROM transaction_contacts_view tcv
- --LEFT JOIN contacts c ON c.id = tcv.contact_id
- LEFT JOIN addresses a ON a.id = tcv.address_id
- WHERE
- (
- --c.name ILIKE '%'||'sprint'||'%'
- --OR c.first_name ILIKE '%'||'sprint'||'%'
- --OR c.last_name ILIKE '%'||'sprint'||'%'
- --OR c.company ILIKE '%'||'sprint'||'%'
- a.address1 || ' ' || a.address2 ILIKE '%'||'sprint'||'%'
- OR a.city || ', ' || a.code ILIKE '%'||'sprint'||'%'
- OR a.county ILIKE '%'||'sprint'||'%'
- )
Add Comment
Please, Sign In to add comment