Guest User

Untitled

a guest
May 21st, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. select distinct ID
  2. from dbo.XXX
  3.  
  4. Select distinct name
  5. from dbo.XXX
  6.  
  7. Select distinct age
  8. from dbo.XXX
  9.  
  10. Select ID, count(id) as [ID_Recurrence]
  11. from dbo.XXX
  12. group by ID
  13.  
  14. Select Age, count(age) as [Age_Recurrence]
  15. from dbo.XXX
  16. group by Age
  17.  
  18. Select Name, count(name) as [Name_Recurrence]
  19. from dbo.XXX
  20. group by Name
  21.  
  22. select COUNT(distinct id) uniqueIDCount
  23. from dbo.XXX
  24.  
  25. SELECT DISTINCT ID FROM SomeTable
  26. SELECT DISTINCT ID , SCORE FROM SomeTable
  27.  
  28. select t.id, t.player_name, t.team
  29. from tablename t
  30. join (select team, min(id) as minid from tablename group by team) x
  31. on x.team = t.team and x.minid = t.id
Add Comment
Please, Sign In to add comment