高分求多表查询语句
table1
create table vits
(
Vits_ID int identity(1,1) PRIMARY KEY,
Vits_name varchar(20) not null
)
go
table 2
create table specialties
(
Specialties_ID int identity(1,1) primary key,
Specialties_name varchar(20) not null
)
go
table 3
create table vet_specialties ---此表可不要
(
Vit_ID int foreign key REFERENCES vets(Vits_ID) ,
Specialty_ID int foreign key REFERENCES specialties(Specialties)
)
go
这三张表是查询兽医名和他的专科
要求 一位兽医可有多个专科
一个专科可有多个兽医
查询一位兽医 此兽医名和对应其所有专业都查询出来