Comments
3 comments
-
This doesn't execute as valid syntax, without Prompt installed, in SQL 2017.
Are you sure this is a Prompt problem? Where are you seeing this as valid SQL? -
@version 'Microsoft SQL Server 2014 (SP2-GDR) (KB4057120) - 12.0.5214.6 (X64) Jan 9 2018 15:03:12 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) ', SSMS v17.8.1:
-
Ok different day a different result, I've rebooted since so perhaps my ssms was just playing up.
So now it works for me after formatting, without the brackets:
Add comment
Please sign in to leave a comment.
,SUM(CAST([NumberOfItems]AS bigint)) AS NumberOfItems
FROM
( VALUES ( 'Item1', 12, 22 )
, ( 'Item2', 14, 25 ) ) AS orders( Name, NumberOfProducts, NumberOfItems )
GROUP BY Name
,SUM(CAST(orders.NumberOfProductsAS bigint)) AS NumberOfProducts
,SUM(CAST(orders.NumberOfItemsAS bigint)) AS NumberOfItems
FROM
( VALUES ( 'Item1', 12, 22 )
, ( 'Item2', 14, 25 ) ) AS orders( Name, NumberOfProducts, NumberOfItems )
GROUP BY orders.Name