Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Select object_id
  2. from objects
  3. where object_id in (select object_id from properties where gender="male") and
  4. object_id in (select object_id from properties where married="yes") ;
  5.  
  6. (select object_id from properties where gender="male")
  7. intersects
  8. (select object_id from properties where married="yes");
  9.  
  10. select t.* from
  11. test t
  12. join test t1 using(object_id)
  13. where t.`key` = 'gender'
  14. and t1.`key` = 'married'
  15. and t.`value` = 'male'
  16. and t1.`value` = 'yes'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement