CREATE TABLE [Users_Reg]
(
[User_ID] [int] IDENTITY (1, 1) NOT NULL CONSTRAINT User_Reg_P_KEY PRIMARY KEY,
[Name] [varchar] (50) NOT NULL,
[Type] [varchar] (50) NOT NULL /*Technician/Radiologist*/
)
CREATE Table [Study]
(
[UID] [INT] IDENTITY (1,1) NOT NULL CONSTRAINT Patient_Study_P_KEY PRIMARY KEY,
[Radiologist] [int], /*user id of Radiologist type*/
[Technician] [int], /*user id of Technician type*/
)
select * from Study
inner join Users_Reg
on Users_Reg.User_ID=Study.Radiologist
在 patient_study 表中,Radiologist 或 Technician 的值可能为 0。我如何从查询中获取技术人员姓名和放射科医生姓名。