|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL Query
Hi,
I'm a little lost, I have a table of records with a column that has upto 11 different options, I would like to get a count of each option i.e. Column names build_name, reason2 record1, misc record2, Multiple Tasks record3, misc record4, Pending Date etc what I need is a count of each type i.e. misc = 2 Pending Date = 1 Multiple Tasks = 1 etc Any help will be appreicated. Regards, Sanjay |
|
#2
|
||||
|
||||
|
Assuming that the column "reason2" contains your options, try this statement:
SELECT COUNT(*), reason2 FROM Tablename GROUP BY reason2 ORDER BY reason2 The ORDER BY reason2 part is optional, if you want it to order alphabetically. |
|
#3
|
|||
|
|||
|
Thanks very much Scorpions4ever, I went completely brain dead!
Cheers |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > SQL Query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|