[PHP] Re: Sort by bigger count(*)

2001-08-01 Thread Richard Lynch
> I made a query that uses count(*) > now how can i get the results sorted following the biggest count(*) result? select count(*) as score from foo group by y order by score desc may do the trick... I often have trouble with aggregates not being allowed where I want them or not being able to ag

[PHP] Re: Sort by bigger count(*)

2001-07-31 Thread Andrew Sterling Hanenkamp
Unless you've used GROUP BY you'll only return one row. I think that something like SELECT x, count(y) FROM table GROUP BY y ORDER BY count(y); Ought to work. Later, Sterling Elias wrote: > Hello, > > I made a query that uses count(*) > now how can i get the results sorted following the big