呵呵,也算吧,
我是先把表分成2个试图,在用表连接试图做.
的出很多数据不知道怎么区啊.
name c# winfrom java
aaa 70 90 80
aaa 80 90 80
aaa 90 90 80
bbb 75 90 80
bbb 85 90 80
bbb 95 90 80
aaa 70 90 85
aaa 80 90 85
aaa 90 90 85
bbb 75 90 85
bbb 85 90 85
bbb 95 90 85
aaa 70 95 80
aaa 80 95 80
aaa 90 95 80
bbb 75 95 80
bbb 85 95 80
bbb 95 95 80
aaa 70 95 85
aaa 80 95 85
aaa 90 95 85
bbb 75 95 85
bbb 85 95 85
bbb 95 95 85
我只要取
aaa 70 90 80
bbb 75 95 85
,不知道怎么取,能教我一下吗。
这是我写的代码比较麻烦看看那不对
use pubs
go
if exists (select name from sysobjects where name = 'text2')
drop view text2
go
create view text2
as
select * from text where kemu = 'winfrom'
if exists (select name from sysobjects where name = 'text1')
drop view text1
go
create view text1
as
select * from text where kemu = 'java'
go
select * from text1
select * from text2
select * from text
go
select text.name,
c# = text.fenshu,winfrom= text2.fenshu ,java = text1.fenshu
from text,text1,text2
go