Data Compare

  • I have the following, I have an stored procedure in which I'm comparing information with both tables.

    For example...

    Table1

    ID Name Quantity

    1 AA 10

    2 BB 20

    3 CC 20

    Table2

    ID Name Quantity

    1 AA 5

    2 BB 10

    My Results

    ID Name Quantity

    1 AA 5

    2 BB 10

    I'm comparing tables y subtracting the quantity y showing the results. But on Table1 I have the third row that is not present on table2 but I need to show it always so my result has to be like this:

    ID Name Quantity

    1 AA 5

    2 BB 10

    3 CC 20

    I was thinking something like this...

    If (exists(sql))

    return just results on table1

    else

    return normal query

    But I'm having problems on the If condition, don't got very clear on how to build my query so it lets me know if that row number 3 on table1 is present on table 2

  • This was removed by the editor as SPAM

  • Definetely that was very useful for me.

    Thanks

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

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