"He Shiming" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
>> select NAME, group_concat(COUNT), group_concat(TYPE)
>> from (
>> select T1.NAME NAME, T2.COUNT COUNT, T2.TYPE TYPE
>> from T1 left join T2 on T1.ID=T2.REFID
>> order by T2.COUNT);
>>
> Thanks for the hint. It works,
> First, note that left join is a red herring here, since you don't in fact
> have any records in T1 without a matching record in T2.
>
> Try this:
>
> select NAME, group_concat(COUNT), group_concat(TYPE)
> from (
> select T1.NAME NAME, T2.COUNT COUNT, T2.TYPE TYPE
> from T1 left join T2 on
"He Shiming" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
> I need some help on a particular sql statement syntax. Consider the
> following tables:
>
> T1:
> ID, NAME
> 1, John
>
> T2:
> REFID, COUNT, TYPE
> 1, 9, B
> 1, 5, U
> 1, 8, T
>
> I have the following statement:
> select
Hi,
I need some help on a particular sql statement syntax. Consider the following
tables:
T1:
ID, NAME
1, John
T2:
REFID, COUNT, TYPE
1, 9, B
1, 5, U
1, 8, T
I have the following statement:
select T1.NAME, group_concat(T2.COUNT), group_concat(T2.TYPE) from T1 left join
T2 on T1.ID=T2.REFID;
4 matches
Mail list logo