|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I am working on a little project, I need to make some lookups in a MySQL table.
Table: ID name type 1 John a 2 Martin a 3 Winston c 4 Mark b 5 Bill b I then need to make a list of which types there are. EG: Types: a b c And I also need to make a count of how many of each type there are EG: Type Count a 2 b 2 c 1 I am using PHP3 to interface the MySQL db, how can I do this? -- Anders |
|
#2
|
|||
|
|||
|
select distinct(type) from table_name; select type, count(type) from table_name group by type; |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Counting in MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|