Guest User

Untitled

a guest
May 7th, 2012
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. Is there some way to select the first table without writing all the fields names in the query?
  2. SELECT DISTINCT t1.*
  3. from T1
  4. join t2 on condition
  5.  
  6. SELECT DISTINCT T1.*
  7. FROM T1 JOIN T2 ON T1.id = T2.id;
  8.  
  9. SELECT *
  10. FROM T1
  11. WHERE id IN (SELECT id FROM T2);
Advertisement
Add Comment
Please, Sign In to add comment