Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select object_id
- from objects
- where object_id in (select object_id from properties where gender="male") and
- object_id in (select object_id from properties where married="yes") ;
- (select object_id from properties where gender="male")
- intersects
- (select object_id from properties where married="yes");
- select t.* from
- test t
- join test t1 using(object_id)
- where t.`key` = 'gender'
- and t1.`key` = 'married'
- and t.`value` = 'male'
- and t1.`value` = 'yes'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement