![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
If I have a table as such.. Name Age -------------- Eric 1 Sarah 2 Jeff 1 Ted 4 Mary 1 Sam 3 How can I do a single sql query that displays the following Age 1 Age 2 Age 3 Age 4 3 1 1 1 TIA select |
#3
| |||
| |||
|
|
"asdf" <scottphelps (AT) noemailplease (DOT) com> wrote in message news:6EKIf.33213$H71.32701 (AT) newssvr13 (DOT) news.prodigy.com... If I have a table as such.. Name Age -------------- Eric 1 Sarah 2 Jeff 1 Ted 4 Mary 1 Sam 3 How can I do a single sql query that displays the following Age 1 Age 2 Age 3 Age 4 3 1 1 1 TIA select (select count(*) from age where age=1) age_1, (select count(*) from age where age=2) age_2, (select count(*) from age where age=3) age_3, (select count(*) from age where age=4) age_4 from dual; |
![]() |
| Thread Tools | |
| Display Modes | |
| |