comparing rows in 2 tables

  • I am new to TSQL.

    Have two tables with rows item_guid . I have to join these two tables and check for the item_guid which are not present in the item_guid of second table

    select * from m_items as o join m_o_items as b on o.item_guid!= b.order_item_guid

    is going to infinite loop. checking the each and every item_guid with each and every row guid of second table

  • yes that will send you into a loop. try using sub query instead

    select * from m_items where item_guid not in (select order_item_guid from m_o_items)

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

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