left join

  • From: Jeff Berwick <mailinglists@xxxxxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Fri, 1 Apr 2011 21:00:46 -0400

Hi listers,

My understand of the left join keyword in mysql is that it will return all the 
items on the left ide regarding to whether they have a corresponding entry on 
the right.  I have two tables:

clients (containing a list of clients)
contracts (containing a list of contracs with those clients)

I am using:

select C.clientid, C.name, max(datesigned) from clients C left join contracts 
CT on C.clientid = CT.clientid where datesigned < 2004-02-29" group by 
CT.clientid;

I should get all 11 clients returned with null values in the datesigned field.  
However, I only get three.

Can anybody provide me with some understanding?

Thx,
Jeff

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: