Forum Replies Created

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

  • RE: Check if both fields from table B are in table A

    Yes. Thank you. Will do in the future.

  • RE: Check if both fields from table B are in table A

    Sorry Drew.

    Tables

    1.tablexm

    (1_id(nvarchar(50),

    2_id(nvarchar(50))

    2.item_relation_table

    (parent_id (nvarchar(50),

    child_id(nvarchar(50),

    relation(char(1)))

    3.item

    (product_id(nvarchar(50),

    item_name(nvarchar(750)),

    item_desc(text),

    mfg(nvarchar(50)),

    active(char(1)))

    Sample Data

    tablexm

    BAT 12355, BER 222222

    BAT 12355, CVF 234455

    ART 11111, VFF HHHHH

    item_relation

    BAT 12355, BER 222222, A

    BAT 12355, CVF 234455, A

    item

    BAT 12355, Baseball bat, Normal bat, BAT 12355,...

  • RE: Check if both fields from table B are in table A

    Thanks for the responses. Here is my code currently:

    INSERT INTO item_relation_table

    (parent__id,

    child__id,

    relation)

    SELECT xm.1_id, xm.2_ID,

    'A',

    from tablexm xm

    where xm.1_id != xm.2_ID and

    exists(select 1 from item ip WHERE ip.mfg = xm.1_id and...

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