|
Posted by <info on 09/14/06 19:24
If the table B is containing the multiple values from A and you want all
values out of table B displayed, then you should work backwards
table B
id (integer auto_increment etc)
description (varchar 255)
table B
id (integer auto_increment etc)
a_id (int)
field 1
field2
etc
// old
select *.a,*.b from a,b where a.id=b.id group by a.id order by a.date
// new
select *.a,*.b from b,a where b.a_id = a.id group by a.id order by a.date
Jerry
"j0sh" <josh@pixael.com> schreef in bericht
news:4509261a$0$15865$4fafbaef@reader2.news.tin.it...
> Johnny wrote:
>
>> desc doesn't apply to 'group by' AFAIK(not much...)
>> http://www.techonthenet.com/sql/group_by.php
>>
>> desc usually used with 'order by'
>
> sure... but i'm using desc with order by...
>
> the right example is
>
> select *.a,*.b from a,b where a.id=b.id group by a.id order by a.date desc
> (i make a mistake in my example)
Navigation:
[Reply to this message]
|