Re: SQL : multiple SELECT and missing rows.

2001-04-02 Thread Kevin C. Miller
You want to use the "LEFT JOIN" syntax. A general outline would be: SELECT [your fields] FROM accounts LEFT JOIN addresses ON addresses.ID = accounts.ID WHERE ... ORDER ... LIMIT ... This would select all addresses.ID's, including those where accounts.ID is NULL. -Kevin --On Tuesday, April 03

Re: [PHP] SQL : multiple SELECT and missing rows.

2001-04-02 Thread Steve Werby
"Maxim Maletsky" <[EMAIL PROTECTED]> wrote: > As you can see, the main data is in 'accounts', the 'addresses.ID' is UNIQUE > and corresponds to 'accounts.ID'. The fact is that not every account has an > address registered with it. > FROM > accounts, > addresses You're doing a straight join. You

SQL : multiple SELECT and missing rows.

2001-04-02 Thread Maxim Maletsky
Hello Guys, I have a (very simple?) SQL question. I'm more then sure the answer to it is whether "just do this..." or "It's impossible man, how could you even get that into your mind..." I have this database design: (it's more complex of course, but you get an idea) Table 'account