[thelist] MYSQL MULTIPLE TABLES SELECT QUESTION

Tab Alleman talleman at Lumpsum.com
Wed Jul 25 09:46:41 CDT 2007


What you want is the UNION operator.  

SELECT ...
FROM Dickies 
WHERE Gender='F'
UNION 
SELECT ...
FROM Levi
WHERE Gender='F'
UNION
...




> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Onyango, Felix
> Sent: Wednesday, July 25, 2007 10:39 AM
> To: thelist at lists.evolt.org
> Subject: [thelist] MYSQL MULTIPLE TABLES SELECT QUESTION
> 
> 
> Guys, I am somewhat a newbie is MySQL, what I have is several tables
> containing products offered by different manufactures. All tables have
> identical structures.
> 
> What I want to do is to construct a query that will search all the
> tables for a particular column and return ALL (*) data if that column
> matches.
> 
> Here is an example of what I am taking about
> 
> Table 1 = Dickies
> 
> Table 2 = Levi 
> 
>  
> 
> ALL Tables Structure: Gender,Name,P_ID,Color,G_ID,Qty
> 
>  
> 
> "  SELECT * FROM Dickies, levi WHERE Dickies.Gender='F' AND
> Levi.Gender='F'   "
> 
>  
> 
> I been on Google and have read all sorts of documentation but yet to
> find any information on how to construct this query - Maybe I 
> am looking
> for the wrong information. I did however find a lot of documentation
> about using the JOIN statement,  - Could this be the answer? 
> If yes, how
> do I go about it.
> 
>  
> 
> Felix Onyango
> 
> Systems Admin
> 
>  
> 
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



More information about the thelist mailing list