special join query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have two tables([LIVE], [TEST]) each table contains two fields (mnemonic,
barcodes)

the mnemonics in each table match, but the LIVE table may have more barcodes
than in TEST.

the joined field would be mnemonics
how do i query the results that display the barcodes that are in LIVE but
not TEST ?
 
samuel said:
i have two tables([LIVE], [TEST]) each table contains two fields (mnemonic,
barcodes)

the mnemonics in each table match, but the LIVE table may have more barcodes
than in TEST.

the joined field would be mnemonics
how do i query the results that display the barcodes that are in LIVE but
not TEST ?


SELECT Live.*
FROM Live LEFT JOIN Test
ON Live.barcodes = Test.barcodes
WHERE Test.barcodes Is Null
 
what if both tables contain barcodes, but the barcodes are different for the
same mnemonic ?

Marshall Barton said:
samuel said:
i have two tables([LIVE], [TEST]) each table contains two fields (mnemonic,
barcodes)

the mnemonics in each table match, but the LIVE table may have more barcodes
than in TEST.

the joined field would be mnemonics
how do i query the results that display the barcodes that are in LIVE but
not TEST ?


SELECT Live.*
FROM Live LEFT JOIN Test
ON Live.barcodes = Test.barcodes
WHERE Test.barcodes Is Null
 
I guess I'm not sure what you want. Maybe this is it?

SELECT Live.*
FROM Live LEFT JOIN Test
ON Live.barcodes = Test.barcodes
AND Live.mnemonic = Test.mnemonic
WHERE Test.barcodes Is Null
--
Marsh
MVP [MS Access]

what if both tables contain barcodes, but the barcodes are different for the
same mnemonic ?

samuel said:
i have two tables([LIVE], [TEST]) each table contains two fields (mnemonic,
barcodes)

the mnemonics in each table match, but the LIVE table may have more barcodes
than in TEST.

the joined field would be mnemonics
how do i query the results that display the barcodes that are in LIVE but
not TEST ?
Marshall Barton said:
SELECT Live.*
FROM Live LEFT JOIN Test
ON Live.barcodes = Test.barcodes
WHERE Test.barcodes Is Null
 
Back
Top