Tag Info

New answers tagged


You need to do the following: Create a user defined variable to be the lineitem counter (called @line) Assign the header lineitem 1000000000 (1 billion) Assign the footer lineitem 2000000000 (2 billion) Display substring of @line starting from column 2 for the footer UNION SELECT your query first (creates column names) with header and footer in a subquery ...


You need to use a derived table or a CTE. Using derived table: SELECT A, SUM(B) AS SumQuantity, MIN(D) AS MinPrice -- etc FROM ( SELECT CountryCode + ProductNumber + StockType AS A, Quantity AS B, Description AS C, Price AS D FROM dbo.vwSalesInvoiceWHandling UNION ...

Top 50 recent answers are included