Date: 05/14/01
- Next message: wsheldah <email protected>: "[phplib] subscription"
- Previous message: James Johnson: "Re: [phplib] Removing passed variables with frames"
- Maybe in reply to: Klaus Seidenfaden: "Sv: [phplib] OT: Joining Tables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Klaus wrote:
>select u.username, p.firstname, c.company, h.smoker
>from users as u, persons as p, companies as c, health_info as h
>where u.userid = p.userid
> and u.userid = c.userid
> and u.userid = h.userid
> and u.userid = '39d0f11ad7b98ea0'
Actually, in this case it'd probably be better to do a left join.
Otherwise if someone doesn't have an entry in the company table
(or whatever) they won't show up in the list. something like:
select u.username, c.company from users as u left join company as
c on u.userid=c.userid
--Jesse
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: wsheldah <email protected>: "[phplib] subscription"
- Previous message: James Johnson: "Re: [phplib] Removing passed variables with frames"
- Maybe in reply to: Klaus Seidenfaden: "Sv: [phplib] OT: Joining Tables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

