Transform query

sql server India
  • 18 years ago

    SUBSTITUTE FOR TRANSFORM QUERY IN SQL SERVER



    i HAVE A TABLE TBL WITH FOLLOWING DATA



    customer    region            sale



    A        DELHI            $100.00
    B        CHANDIGARH        $100.00
    C        DELHI            $200.00
    D        DELHI            $300.00
    E        CHANDIGARH        $200.00





    I EXECUTE THE FOLLOWING QUERY IN MS-ACCESS


    transform sum(SALE)
    select  CUSTOMER
    from TBL
    group by CUSTOMER
    pivot REGION



    THE OUTPUT IS:-------------------------------------
    CUSTOMER    CHANDIGARH    DELHI
    A                $100.00
    B        $100.00    
    C                $200.00
    D                $300.00
    E        $200.00    





    How To Do This In Sql Server

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Never trust a programmer in a suit.” - Anonymous