有关GridView的小问题
怎么在GridView中显示两个不相关的表格?不要把两个表格的属性放到一个表格中
--select * from student --select * from course --select * from sc --计算每个学生每门课成绩,统计总分,平均分,并排序,用到了游标 declare @sql nvarchar(4000) declare @cno nvarchar(50) declare @cname nvarchar(50) set @sql='select student.sname as 姓名,student.sage as 年纪,student.ssex as 性别,student.sdept as 部门, ' declare contact_wpzl cursor FOR select cno,cname from course open contact_wpzl fetch next from contact_wpzl into @cno,@cname while @@FETCH_STATUS =0 begin set @sql=@sql+'max(case when '''+@cno+''' then sc.grade else 0 end)['+@cname+'], ' fetch next from contact_wpzl into @cno,@cname end set @sql=@sql+'sum(sc.grade)[总分], avg(sc.grade)[平均分] from sc left join student on student.sno=sc.sno left join course on group by student.sname,student.sage,student.ssex,student.sdept order by [平均分] desc' close contact_wpzl deallocate contact_wpzl --print @sql exec (@sql)