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;

And the result is:
John, 9,5,8, B,U,T

What I want is to make the join part sorted by T2.COUNT, so that the result 
goes:
John, 5,8,9, U,T,B

I can't think of a way to make it happen. I tried putting in an additional 
ORDER BY T2.COUNT but it has no effect. Any hints?

Thanks in advance,
He Shiming
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to