Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Sum
- ```
- SELECT Color, SUM(ListPrice), SUM(StandardCost)
- FROM Production.Product
- WHERE Color IS NOT NULL
- AND ListPrice != 0.00
- AND Name LIKE 'Mountain%'
- GROUP BY Color
- ORDER BY Color;
- GO
- ```
- ### Count All Colums
- ```
- select t.name TableName, i.rows Records
- from sysobjects t, sysindexes i
- where t.xtype = 'U' and i.id = t.id and i.indid in (0,1)
- order by TableName;
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement