求一个VIEW(视图)写法
我有3个表, 关小如下
表1 Grade
GradeID GradeName
1 grade1
2 grade2
3 grade3
4 grade4
表2 Attribute
AttID AttName
1 A
2 C
3 N
4 F
表3 GradeAttribute
GradeAttributeID GradeID AttID AttSize
1 1 1 5
2 1 2 7
3 1 4 0
4 2 1 4
5 2 4 5
6 4 2 5
7 4 3 0
我现在想写一个VIEW, 显示结果如下
GradeID GradeName GradeAttribute
1 grade1 A5 C7 F0
2 grade2 F0 A4
4 grade4 C5 N0
谢谢大家了
------解决方案--------------------
create table Grade
(GradeID int,GradeName varchar(10))
insert into Grade
select 1,'grade1' union all
select 2,'grade2' union all
select 3,'grade3' union all
select 4,'grade4'
create table Attribute
(AttID int,AttName varchar(5))
insert into Attribute
select 1,'A' union a