How to get a part of the SELECT results

How to get a part of the SELECT results

am 11.05.2006 21:17:51 von dutch disCo

Hi,

I have two tables that relate to each other by users ids. I want to
fetch a fow as follows:

SELECT user_id,username,homedir FROM users,ftpusers WHERE user_id=id AND
username='zdzisio';

But instead of getting this:

+---------+------------------+--------------------+
| user_id | username | homedir |
+---------+------------------+--------------------+
| 11 | zdzisio | /home/zdzisio/ |
+---------+------------------+--------------------+


I want to get something like this:

+--------------------+
| homedir |
+--------------------+
| /home/zdzisio/ |
+--------------------+


In other words: I want to select all three fields from both tables but
display only one of them.

How to do that?

Any help appreciated
Respect
dd

Re: How to get a part of the SELECT results

am 12.05.2006 00:32:20 von zac.carey

SELECT homedir FROM users,ftpusers WHERE user_id=id AND
username='zdzisio';