Jump to content

[SOLVED] counting unique db table rows


soycharliente

Recommended Posts

What's the best/quickest way to count unique row entries?

 

I have a table of data with one field being 'loc' and want to count each unique loc.

 

So if I have:

id loc

1 mexico

2 mexico

3 china

4 usa

5 usa

 

I want to run a query and return something like:

mexico 2

china 1

usa 2

Link to comment
https://forums.phpfreaks.com/topic/57656-solved-counting-unique-db-table-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.