• dwilliscp (8/14/2012)


    dwilliscp (8/14/2012)


    Thanks for your help... I just could not figure out how to word the statement ... looking at some samples I found on the internet.

    Thanks for the help from both of you.

    yep, problem with the join.. I need to know that there were 55 Notifications, but not get 55 rows. I guess we could do a distinct on the outside query.

    How many rows does this return?

    SELECT

    d.Delivery,

    d.Delivery_Item,

    --n.Sales_Order_Number,

    d.REF_DOC--,

    --n.Notification_cnt

    FROM ztb_Carrier_Delivery_Metrics d

    WHERE d.REF_DOC = '0002619226'

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden