SQL Server & Tibco Spotfire Ideas & Samples
SQL, TSQL, Tibco Spotfire...
Aug 8, 2010
T-SQL RollUp
--Sample Script
SELECT CASE WHEN (GROUPING(Data_type) = 1) THEN 'ALL'
ELSE ISNULL(Data_type, 'UNKNOWN')
END AS Data_type,
SUM(Type_id) AS Type_idSum
FROM Staging.Data_Type
GROUP BY Data_type WITH ROLLUP
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment