I posted earlier this week about how to select from two different tables with
an OR -- selecting rows from either table and putting them into one.
That was easily accomplished with a UNION statement (AFTER upgrading to
MySQL 4.0.x).
Now I'm doing almost the opposite. I have two tables, TestCases, and TestTemp
(a temporary table). I want to select any rows in TestCases AND TestTemp. I
know I can do that if I go through and match field by field:
SELECT * FROM TestCases AS C, TestTemp AS T WHERE
C.Field1 = T.Field1 AND C.Field2 = T.Field2;
(and so on if there are more fields).
Is there a shortcut to this? Is there a quick way to say
SELECT * FROM TestCases AS C, TestTemp AS T WHERE (allfields = allfields);
I'm calling from Perl, so I can write a routine that will go through and list
every darn field, but I'd like to find a shorter and faster way to do it.
Thanks!
Hal
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php