CREATE VIEW语法不正确(MySQL)

时间:2014-10-09 14:47:12

标签: mysql sql view

我试图从这两个表中创建一个视图:

enter image description here

我当前的SQL代码没有显示错误,它只显示零结果:

CREATE VIEW `current_job` AS SELECT
  a1.OBJ_NAME,
  a1.TYP,
  a1.OBJ_ID,
  a1.DEVICE_ID,
  a2.DESCRIP,
  a3.CATEGORY,
  a4.INFORMATION    
FROM `job21433` a1, `master_setpoints_view` a2, `master_setpoints_view` a3, `master_setpoints_view` a4
WHERE 
  a1.JOBNUM = "21433189-01"
AND
 a2.DESCRIP = a1.OBJ_NAME
AND
 a3.CATEGORY = a1.OBJ_NAME
AND
 a4.INFORMATION = a1.OBJ_NAME

我只是想获得" DESCRIP"," CATEGORY","信息"从master_setpoints_view中将其添加到我的新视图中。

有人可以帮忙吗?我在哪里陷入困境?

编辑用于创建视图{1}}的SQL代码:

master_setpoints_view

0 个答案:

没有答案