Mean something like this?
select '1' as rownum, count(serviceid) as id
from serviceslog
where serviceid='1'
and partition not like '%test%'
and component not like '%test%'
and component not like '%do not bill%'
and occurence between '2009-05-01 05:00:00' and '2009-06-01 04:59:59'
group by serviceid
union
select '2' as rownum, count(serviceid) as id
from serviceslog
where serviceid='3'
and partition not like '%test%'
and component not like '%test%'
and component not like '%do not bill%'
and occurence between '2009-05-01 05:00:00' and '2009-06-01 04:59:59'
group by serviceid
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
hi
If you want all same fields for different id than you can use 'in ' with where clause.
select count(serviceid) as id
from serviceslog
where serviceid in ('1','2')
and partition not like '%test%'
and component not like '%test%'
and component not like '%do not bill%'
and occurence between '2009-05-01 05:00:00' and '2009-06-01 04:59:59'
group by serviceid
Thanks
Tulsa
Junior Poster in Training
77 posts since May 2009
Reputation Points: 13
Solved Threads: 15