Home Forums Programming General Help with complex Stored Procedure RE: Help with complex Stored Procedure

  • I'm leaving the design discussion out for a moment...

    You might want to use a LEFT OUTER JOIN together with a CASE statement. (column based result set, meaning results for lkup_Record_Regions_Serv in one column and lkup_Record_Regions in another one) or

    use a UNION query (or a cte) to get the results "row based".

    Please note that I didn't take the time to link to a picture of your expected result...

    If you need a more detailed answer, please provide a moer detailed question.

    Have a look at the first article referenced in my signature for a good example how to do it 😉



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]