Tuesday, June 14, 2005

MYSQL: select duplicate fields from table

SELECT `$col`, count(`$col`) as `num`
FROM `$table`
GROUP BY `$col`
ORDER BY `num` desc

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home