将多个计算的数据项,绑定在一个GridView中 select count(type1)as QTY8 from record where type1='88'and dependtype='2'
select count(type1)as QTY7 from record where type1='87'and dependtype='2' 这样将产生多个数据集~~~将这些数据集绑定GridView,具体怎么实现~~~~谢谢~~~~(代码)
select count(type1)as QTY7 from record where type1='87'and dependtype='2' 这样将产生多个数据集~~~将这些数据集绑定GridView,具体怎么实现~~~~谢谢~~~~(代码)
create table result
(
id primary key not null,
name varchar(20),
value int
)
insert into result(name,value) select 'QTY8 ',QTY8 from (select count(type1)as QTY8 from record where type1='88'and dependtype='2')
类似
declare QTY7 int
set QTY8 =(select count(type1)as QTY8 from record where type1='88'and dependtype='2')
set QTY7 =(select count(type1)as QTY7 from record where type1='87'and dependtype='2')
select QTY7 as 'QTY7',QTY8 as 'QTY8 '
union
select count(type1) from record where type1='87'and dependtype='2'