MySQL Forums
Forum List  »  Newbie

Re: struggling with this query from two tables? anyone..
Posted by: Ramalingam Chelliah
Date: August 30, 2004 06:49AM

Hi ,
Check if this helps you ...

I have joined 'hosts' table twice with a 'sites' table ....


mysql> SELECT X.hostname,Y.hostname,Z.expires
FROM
hosts as X,hosts as Y,sites as Z
WHERE Z.host_id_1=X.ID AND Z.host_id_2=Y.ID
AND Y.ID=1;

Last comparision is with regard to Athens' ID 1 ...
You can also compare it with hostname like Y.hostname='Athens'


Hope this helps you ....

Regards,
Ram.









We Learn the Most When we have to Invent

Options: ReplyQuote


Subject
Written By
Posted
Re: struggling with this query from two tables? anyone..
August 30, 2004 06:49AM


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.