Just Some Help To Impress My New Boss Pls

  • i add the file

    i need help to build sql query as show in file

    tnx all

    http://1drv.ms/1R21ene

  • One, not enough information to even write a query.

    Two, based on the information provided this should be a relatively simple query to write.

    You may want to read to the first article I have referenced below in my a signature block. It will show you what we need posted and how to post it to answer questions like this one.

  • asafswis2 (10/23/2015)


    i add the file

    i need help to build sql query as show in file

    tnx all

    http://1drv.ms/1R21ene

    Links to speadsheets just aren't going to cut it for readily consumable data. Please read and heed the article that Lynn pointed you to so that we might help you better. Thanks.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • In the future, actual SQL statements to create the tables and insert rows would be required. But, for this request, the code should do what you're trying to do, I think.

    SELECT T1.*

    FROM T1

    INNER JOIN (

    SELECT [Order No]

    FROM T1

    GROUP BY [Order No]

    HAVING COUNT(DISTINCT [delivery date]) > 1

    ) AS orders_with_multi_deliv_dates ON orders_with_multi_deliv_dates.[Order No] = T1.[Order No]

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • THANK YOU

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply