order by a count of another table
| From: | Noah Spitzer-Williams | Date: | Sat, 06 Oct 2001 00:05:53 +0000 |
| Subject: | order by a count of another table | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13059@lists.php.net to get a copy of this message | ||
hey guys,
i want to show a list of rows from a table sorted by the count of
another table. the first table has a username field and so does the other
table. so i want to sort the first table by how many rows that has the
username from the other table.
so something like this although i know its not sql syntax:
select * from table order by [count(*) from other_table where
username=table.username]
can anyone help me out?
thanks guys!