Please kindly help (urgent SQL+ question)
From: Lee Ka Wo <leekawo_at_netvigator.com>
Date: Sat, 20 Jun 1998 18:20:54 +0800
Message-ID: <358B8D06.65C6_at_netvigator.com>
Dear friends,
-------------------------------------------------------
Please visit my homepage (IQ Paradise) http://home.netvigator.com/~leekawo My ICQ: 996903 Received on Sat Jun 20 1998 - 12:20:54 CEST
Date: Sat, 20 Jun 1998 18:20:54 +0800
Message-ID: <358B8D06.65C6_at_netvigator.com>
Dear friends,
I have a SQL plus question. I have a table like this (just five records):
Name Age ------------ --- chan tai man 10 lee ka wo 20 young man 21 old man 60 old woman 62
I want to do a query to count the number of
people with age <60 (young) and number of people >=60 (old). I hope the
result will
be like this:
Count(*) Age_range
- --------- 3 young 2 old
I wonder whether the following statement can serve my purpose.
select count(*), decode(age, <60,'young',>=60,'old')Age_range from people
Please kindly advise. Thanks a lot !!!
Lee Ka wo, Ken
--
-------------------------------------------------------
All people have one thing in common, they are DIFFERENT
-------------------------------------------------------
Please visit my homepage (IQ Paradise) http://home.netvigator.com/~leekawo My ICQ: 996903 Received on Sat Jun 20 1998 - 12:20:54 CEST