Information from a column in one table, using it for another

A

Anonymous

Guest
Alright, this is bothering me. Take note that I'm not great at mySQL yet =/

I have one table called 'lists', with columns one, two, and three.

I'd like to pull the information stored in column one of lists, and use that to get information from a whole nother table.

For example:

in the table lists, and the row I want, one = philips

then ultimately I want:

$query = "SELECT * FROM episodes WHERE name='philips';

I can't seem to get it any which way I try. I'd really love some help here, thanks in advance!
 
Try:
Code:
SELECT name FROM episodes
  WHERE EXISTS (SELECT * FROM lists
                WHERE lists.one = episodes.name);
Try also:
Code:
SELECT name FROM episodes WHERE name IN (SELECT one FROM lists);

Cheers
 
Back
Top