Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- -- here are some columns straight from the subquery and some hardcoded columns like
- 'My company' AS CompanyName
- -- and here is the most important part
- SUM(Subq.ImportantFloatWithBigPrecision)
- FROM
- (
- SELECT
- -- Here are some simple columns fetched from table and after that:
- udf.GetSomeMappedValue(Value) AS MappedValueFromFunction
- ,ImportantFloatWithBigPrecision
- FROM MyVeryBigTable
- WHERE ImportantFloatWithBigPrecision <> 0
- AND(...)
- ) Subq
- GROUP BY everything except SUM(Subq.ImportantFloatWithBigPrecision)
- HAVING SUM(Subq.ImportantFloatWithBigPrecision)<>0
- ORDER BY (...)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement