Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. +--------+-------+------+--+
  2. | Object | Event | Time | |
  3. +--------+-------+------+--+
  4. | Obj1 | A | 1 | |
  5. | Obj1 | B | 3 | |
  6. | Obj2 | A | 7 | |
  7. | Obj2 | B | 4 | |
  8. +--------+-------+------+--+
  9.  
  10. SELECT DISTINCT Object from
  11. (SELECT * from
  12. (SELECT * FROM table
  13. INNER JOIN (SELECT Object Obj FROM table WHERE event LIKE '%A%' AS temp_table
  14. ON table.Object=temp_table.Obj) AS temp_final WHERE event LIKE '%B%')
  15. AS temp2;
  16.  
  17. Obj1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement