Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. ### Sum
  2. ```
  3. SELECT Color, SUM(ListPrice), SUM(StandardCost)
  4. FROM Production.Product
  5. WHERE Color IS NOT NULL
  6. AND ListPrice != 0.00
  7. AND Name LIKE 'Mountain%'
  8. GROUP BY Color
  9. ORDER BY Color;
  10. GO
  11. ```
  12.  
  13. ### Count All Colums
  14. ```
  15. select t.name TableName, i.rows Records
  16. from sysobjects t, sysindexes i
  17. where t.xtype = 'U' and i.id = t.id and i.indid in (0,1)
  18. order by TableName;
  19. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement