Hi Jonathan, all!
Jonathan Mangin wrote:
I have two tables with date and uid cols. in common.
Table 1 has one row per date, Table 2 has a maximum
of 7 rows per date.
select t1.date, t1.val, t2.val from t1
right join t2 on t1.date = t2.date
where t1.date between '2005-08-01' and '2005-08-14'
Hello.
select t1.date, t1.val, t2.val from t1
right join t2 on t1.date = t2.date
where t1.date between '2005-08-01' and '2005-08-14'
and t1.uid = 'me';
Maybe it is better to move a condition on t1 fields from
WHERE to ON part of the query? Or I don't see any sense
in using a RIGHT
I have two tables with date and uid cols. in common.
Table 1 has one row per date, Table 2 has a maximum
of 7 rows per date.
select t1.date, t1.val, t2.val from t1
right join t2 on t1.date = t2.date
where t1.date between '2005-08-01' and '2005-08-14'
and t1.uid = 'me';
Jonathan Mangin [EMAIL PROTECTED] wrote on 10/07/2005 02:57:28
PM:
I have two tables with date and uid cols. in common.
Table 1 has one row per date, Table 2 has a maximum
of 7 rows per date.
select t1.date, t1.val, t2.val from t1
right join t2 on t1.date = t2.date
where t1.date between
Jonathan,
I have two tables with date and uid cols. in common.
Table 1 has one row per date, Table 2 has a maximum
of 7 rows per date.
select t1.date, t1.val, t2.val from t1
right join t2 on t1.date = t2.date
where t1.date between '2005-08-01' and '2005-08-14'
and t1.uid = 'me';
A right join
- Original Message -
From: [EMAIL PROTECTED]
To: Jonathan Mangin [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Friday, October 07, 2005 2:09 PM
Subject: Re: Joining tables, duplicating none
Jonathan Mangin [EMAIL PROTECTED] wrote on 10/07/2005 02:57:28
PM:
I have two tables
Jonathan Mangin [EMAIL PROTECTED] wrote on 10/07/2005 03:47:48
PM:
- Original Message -
From: [EMAIL PROTECTED]
To: Jonathan Mangin [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Friday, October 07, 2005 2:09 PM
Subject: Re: Joining tables, duplicating none
Jonathan