Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.26 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);