You sure can, that's just a simple join, but you have to also use the table2
in the from clause. Like this...
SELECT table1.failed_parts FROM table1, table2 WHERE table1.failed_parts =
table2.valid_parts;
Ilya Sterin
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 05/01/2001 8:04 AM
Subject: sql table joins
Hi,
I am using perl DBI to access an sql server database.
One table has component part numbers that have failed, keyed in by
operators. I need to read in and count these which is no problem but I
also
need to compare them with an approved parts table to make sure that they
are
valid part numbers. Currently I am doing this by reading the failed
parts
into a hash and then using the hash keys as placeholders to query the
parts
valid table.
Is it possible with DBI to do something like
SELECT table1.failed_parts FROM table1 WHERE table1.failed_parts =
table2.valid_parts
thanks Willie
Willie McSweeney
Memory Component Engineer
EMC,
Ovens,
Co.Cork, Ireland.
Tel +00353-21-4281412
Fax +00353-21-4281898
Email <[EMAIL PROTECTED] >