Hi,
I was hoping someone could push me in the right direction for consolidating the following queries into a single pass query. Currently I do the following queries:
db2 "select count(*) as less_equal_100 from household where sptsaccu6 <= 10099" > baby_percent.out
#
db2 "select count(*) as between_101_125 from household where sptsaccu6 >= 10100 and sptsaccu6 <= 12599" >> baby_percent.out
#
db2 "select count(*) as between_126_150 from household where sptsaccu6 >= 12600 and sptsaccu6 <= 15099" >> baby_percent.out
#
db2 "select count(*) as between_151_175 from household where sptsaccu6 >= 15100 and sptsaccu6 <= 17599" >> baby_percent.out
I would like to combine these separate queries into one query that would require only one pass of the household table.
Thank you in advance for the help!
Bill
I was hoping someone could push me in the right direction for consolidating the following queries into a single pass query. Currently I do the following queries:
db2 "select count(*) as less_equal_100 from household where sptsaccu6 <= 10099" > baby_percent.out
#
db2 "select count(*) as between_101_125 from household where sptsaccu6 >= 10100 and sptsaccu6 <= 12599" >> baby_percent.out
#
db2 "select count(*) as between_126_150 from household where sptsaccu6 >= 12600 and sptsaccu6 <= 15099" >> baby_percent.out
#
db2 "select count(*) as between_151_175 from household where sptsaccu6 >= 15100 and sptsaccu6 <= 17599" >> baby_percent.out
I would like to combine these separate queries into one query that would require only one pass of the household table.
Thank you in advance for the help!
Bill