Re: Re: Retrieve information from mutiple tables

From: Date: Sun, 21 Apr 2002 17:15:23 +0000
Subject: Re: Re: Retrieve information from mutiple tables
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-18710@lists.php.net to get a copy of this message
On Monday 22 April 2002 00:53, Prodoc wrote: > E.g. I've got two tables (User and Rights) both contianing UserID, I > want to retrieve some UserID's from the Rights table and use those > UserID's the get the nickname of those users from the User table. > > ("SELECT UserID FROM Rights WHERE...........") > ("SELECT NickName FROM User WHERE...........") > > Is it possible to combine those two statements? Try: SELECT Rights.UserID, User.NickName FROM Rights, User WHERE User.UserID = Rights.UserID -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* HOW YOU CAN TELL THAT IT'S GOING TO BE A ROTTEN DAY: #15 Your pet rock snaps at you. */

« previous php.db (#18710) next »