Re: Getting data from 2 tables if records have same date!

2012-03-01 Thread Shawn L Green
Stupid wrapping helped me to make a simple mistake. I wrote On 3/1/2012 10:40 AM, LUCi5R wrote: SELECT * FROM CUSTOMERS LEFT JOIN CALLS ON CUSTOMERS.PHONE = CALLS.PHONE AND CUSTOMERS.DATE=CALLS.DATE = "02/28/12" But I meant it to be SELECT * FROM CUSTOMERS LEFT JOIN CALLS ON CUSTOMERS.PHONE =

RE: Getting data from 2 tables if records have same date!

2012-03-01 Thread LUCi5R
-Original Message- From: Shawn L Green [mailto:shawn.l.gr...@oracle.com] Sent: Thursday, March 01, 2012 6:57 AM To: luc...@luci5r.com Cc: 'Johnny Withers'; mysql@lists.mysql.com Subject: Re: Getting data from 2 tables if records have same date! Try this: SELECT * FROM CUST

RE: Getting data from 2 tables if records have same date!

2012-03-01 Thread LUCi5R
t on that to understand what you're doing here. Thanks! ~~ LUCi5R e: luc...@luci5r.com w: http://www.luci5r.com -Original Message- From: Halász Sándor [mailto:h...@tbbs.net] Sent: Wednesday, February 29, 2012 2:57 PM To: mysql@lists.mysql.com Subject: Re: Getting data

RE: Getting data from 2 tables if records have same date!

2012-03-01 Thread LUCi5R
[mailto:joh...@pixelated.net] Sent: Wednesday, February 29, 2012 3:15 PM To: luc...@luci5r.com Cc: mysql@lists.mysql.com Subject: Re: Getting data from 2 tables if records have same date! After looking at this again, the query you are using; SELECT *  FROM CUSTOMERS  LEFT JOIN CALLS ON CUSTOMERS.PHONE

Re: Getting data from 2 tables if records have same date!

2012-03-01 Thread David Giragosian
;> but not in the CALLS table. The other 85 were in both tables. >> >> >> >> The above LEFT JOIN query gave me 69 records and quite a few duplicate >> entries. I'm trying to dissect it to understand what exactly it selected. >> >> >> >> Th

Re: Getting data from 2 tables if records have same date!

2012-03-01 Thread Shawn L Green
com Cc: mysql@lists.mysql.com Subject: Re: Getting data from 2 tables if records have same date! Sounds like you need to LEFT JOIN: SELECT * FROM CUSTOMERS LEFT JOIN CALLS ON CUSTOMERS.PHONE = CALLS.PHONE AND CALLS.DATE = "02/28/12" WHERE CUSTOMERS.DATE = "02/28/12"

Re: Getting data from 2 tables if records have same date!

2012-02-29 Thread Hal�sz S�ndor
;>>> 2012/02/29 15:29 -0600, Johnny Withers Sounds like you need to LEFT JOIN: SELECT * FROM CUSTOMERS LEFT JOIN CALLS ON CUSTOMERS.PHONE = CALLS.PHONE AND CALLS.DATE = "02/28/12" WHERE CUSTOMERS.DATE = "02/28/12" But that would only get customers created on 2/28 AND having a call on 2/28 OR

Re: Getting data from 2 tables if records have same date!

2012-02-29 Thread Andrés Tello
; e: luc...@luci5r.com > w: http://www.luci5r.com > > > > > > From: Johnny Withers [mailto:joh...@pixelated.net] > Sent: Wednesday, February 29, 2012 1:30 PM > To: luc...@luci5r.com > Cc: mysql@lists.mysql.com > Subject: Re: Getting data from 2 tables if records

RE: Getting data from 2 tables if records have same date!

2012-02-29 Thread LUCi5R
l@lists.mysql.com Subject: Re: Getting data from 2 tables if records have same date! Sounds like you need to LEFT JOIN: SELECT * FROM CUSTOMERS LEFT JOIN CALLS ON CUSTOMERS.PHONE = CALLS.PHONE AND CALLS.DATE = "02/28/12" WHERE CUSTOMERS.DATE = "02/28/12" But that

Re: Getting data from 2 tables if records have same date!

2012-02-29 Thread Johnny Withers
Sounds like you need to LEFT JOIN: SELECT * FROM CUSTOMERS LEFT JOIN CALLS ON CUSTOMERS.PHONE = CALLS.PHONE AND CALLS.DATE = "02/28/12" WHERE CUSTOMERS.DATE = "02/28/12" But that would only get customers created on 2/28 AND having a call on 2/28 OR not call at all on 2/28. This would give you cu