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 =
-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
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
[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
;> 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
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"
;>>> 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
; 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
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
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
10 matches
Mail list logo