The VALUES clause or building tables out of nothing

https://www.red-gate.com/simple-talk/databases/theory-and-design/values-clause-building-tables-out-nothing 


SELECT 

    EXCEL_LEVEL1_ROLLUP, 

    GROUP_NUMBER

FROM (

    VALUES 

        ('Fuel Sales', 1), 

        ('Conv Store Sales', 1),

        ('Gift Shop Sales', 1),

        ('Other Sales', 1),

        ('Vending/Gift Cost', 2)

    ) AS v (EXCEL_LEVEL1_ROLLUP, GROUP_NUMBER);



Comments

Popular posts from this blog

Using sp_executesql with OPENQUERY

Executing Remote Queries Safely and Efficiently with sp_executesql