Logic

  • Hi everyone,

    I am writing a sproc for reporting purposes:

    I do a simple select with a user filter from a posted table to generate the data needing to be displayed. I just received a request to add some logic linking the posted record to the transactional record.

    I do not need any columns from the transactional table currently (they may change that). How do I bring in the link between the transactional record and the posted record? Is it in a join? Please help?

    Christine Aurora

  • How do I bring the join in if I am not including a column in the select? Would I do a LEFT OUTER JOIN?

    Sorry for the simplistic questions I'd know right off the rip if I had some data to work with but other DBA's are currently working on the build.

  • quote:


    How do I bring the join in if I am not including a column in the select?


    You don't need to include the JOIN column in the select for the JOIN to work:

    SELECT PostedTableField

    FROM PostedTable

    INNER JOIN TransactionTable

    ON PostedTable.JoinKeyField = TransactionTable.JoinKeyField

Viewing 4 posts - 1 through 3 (of 3 total)

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