code_junkie

SQL distinct for 2 fields in a database

Nov 11th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.08 KB | None | 0 0
  1. select distinct c1, c2 from t
  2.  
  3. select c1, c2, count(*)
  4. from t
  5. group by c1, c2
Add Comment
Please, Sign In to add comment