> I thought that this might be the solution:
>
> SELECT file_id FROM temp_tagged;
> GROUP BY file_id
> ORDER BY count (file_id) DESC;
>
> But apparently, it isn't.
>
> Any help would be appreciated.
>
Try
SELECT file_id, count(file_id) FROM temp_tagged GROUP BY file_id ORDER
BY count(file_id) DESC