MySQL Forums
Forum List  »  Newbie

Using row values in LIKE statements
Posted by: crussell
Date: June 04, 2005 05:05PM

Hi all,

I have 2 tables. I need to find a row from the first table that corresponds to a user specified value, take one of the column values and use that to search the second table for a similar value.

Example: Both tables contain videogame data (split for varying reasons). Both tables are indexed seperately and there's no "common" index but I want to find the "true" value from the first and search the second table for all value which are similar to the one culled from the first

Table 1

id name publisher
1 Diablo Blizzard
2 Doom ID Games
3 Qbert who knows

So, the user specifies the ID, SQL gets the corresponding name then uses that within a LIKE.

Is it possible to do this in one statement or is it easier to get the details from Table 1 and fire off a second query to get the results from Table 2 ?

TIA

Crussell

Options: ReplyQuote


Subject
Written By
Posted
Using row values in LIKE statements
June 04, 2005 05:05PM


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.