Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT crm_posts.* FROM crm_posts LEFT JOIN crm_postmeta ON ( crm_posts.ID = crm_postmeta.post_id ) LEFT JOIN crm_postmeta AS mt1 ON (crm_posts.ID = mt1.post_id AND mt1.meta_key = 'project_users' ) LEFT JOIN crm_postmeta AS mt2 ON ( crm_posts.ID = mt2.post_id ) LEFT JOIN crm_postmeta AS mt3 ON (crm_posts.ID = mt3.post_id AND mt3.meta_key = 'project_users' ) LEFT JOIN crm_postmeta AS mt4 ON ( crm_posts.ID = mt4.post_id ) WHERE 1=1 AND (
- (
- ( crm_postmeta.meta_key = 'project_users' AND crm_postmeta.meta_value NOT LIKE '{aa09e48753b99893677d5e1b8ef8a3a0656bebd9a162a8126d1ee2cdf7dc9f7b}\"3\"{aa09e48753b99893677d5e1b8ef8a3a0656bebd9a162a8126d1ee2cdf7dc9f7b}' )
- OR
- mt1.post_id IS NULL
- )
- OR
- (
- (
- ( mt2.meta_key = 'project_users' AND mt2.meta_value NOT LIKE '{aa09e48753b99893677d5e1b8ef8a3a0656bebd9a162a8126d1ee2cdf7dc9f7b}3{aa09e48753b99893677d5e1b8ef8a3a0656bebd9a162a8126d1ee2cdf7dc9f7b}' )
- OR
- mt3.post_id IS NULL
- )
- AND
- (
- ( mt4.meta_key = 'favorite_users' AND mt4.meta_value LIKE '{aa09e48753b99893677d5e1b8ef8a3a0656bebd9a162a8126d1ee2cdf7dc9f7b}3{aa09e48753b99893677d5e1b8ef8a3a0656bebd9a162a8126d1ee2cdf7dc9f7b}' )
- )
- )
- ) AND crm_posts.post_type = 'project' AND ((crm_posts.post_status = 'publish')) GROUP BY crm_posts.ID ORDER BY CAST(mt4.meta_value AS CHAR) DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement