我正在尝试从表PROJECTS
列Project_id
获取数据,并将其用于另一个表Work
,其中PROJECT_ID
也有{{1}}。我会使用什么SQL代码,因为我很难过。
答案 0 :(得分:1)
SELECT -- whatever
FROM
Work
INNER JOIN
Projects ON
Work.PROJECT_ID = Projects.Project_id
编辑:查看语法...添加您需要的任何列。
CREATE VIEW vwWorkProjects
AS
SELECT Work.Work_ID, Work.WorkColumn, Projects.Project_ID, Projects.ProjectColumn
FROM
Work
INNER JOIN
Projects ON
Work.PROJECT_ID = Projects.Project_id