Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

RE: Finding a value in multiple tables

From: Chris Boget <chris.boget(at)wild.net>
Date: Tue Jul 31 2007 - 11:59:33 EDT


> I want to find the value 123 in the field "id" in any one of these
tables.

SELECT id FROM TableA WHERE id = 123
UNION
SELECT id FROM TableB WHERE id = 123
UNION
SELECT id FROM TableC WHERE id = 123

Please note that UNION requires that the same number (and type?) of fields be selected from each table.

thnx,
Chris

-- 
MySQL General Mailing List
For list archives: 
http://lists.mysql.com/mysql
To unsubscribe:    
http://lists.mysql.com/mysql?unsub=lists@pantek.com
Received on Tue Jul 31 12:00:42 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:29:43 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library