MySQL Forums
Forum List  »  MySQL Administrator

Selecting from multiple tables
Posted by: Chandler Reeves
Date: May 05, 2012 07:23PM

First I would like to start out with: "I'm new~ish to mysql and this is my first post to the forum, so if it is in the wrong location then I will repost".

Now onto my issue:
I have three tables with no linking between them. I would like to do a search of one column of each table and return it in a single result with data from each table grouped together.

tbl1:
tbl1_ID
tbl1_data

tbl2:
tbl2_ID
tbl2_otherStuff

tbl3:
tbl3_ID
tbl3_moreStuff

I was thinking something like:

SELECT tbl1.*, tbl2.*, tbl3.* FROM tbl1, tbl2, tbl3 WHERE tbl1.tbl1_data LIKE 'search' OR tbl2.tbl2_otherStuff LIKE 'search' OR tbl3.tbl3_moreStuff LIKE 'search'

but I just keep getting 0 results - no errors

Is there an easyer way to do this in mysql?

Options: ReplyQuote


Subject
Written By
Posted
Selecting from multiple tables
May 05, 2012 07:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.