• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

MySQL question: Ignoring rows with repeat values?

igowerf

Diamond Member
SELECT category, COUNT(*) FROM tablename GROUP BY category

Or something like that, group by should work too, DISTINCT works also
 
If I was designing something like that then I would have two tables.

Table 1: Categories, columns category_id and category_name

Table 2: URLS, columns URL and category_id

Then make category_id in URLS table foreign key to category_id in Categories table.

Just my 2 cents.
 
Originally posted by: Superwormy
SELECT category, COUNT(*) FROM tablename GROUP BY category

Or something like that, group by should work too, DISTINCT works also

Ideally, you want to use SELECT DISTINCT because it is a more efficient way.
 
Back
Top