我的SQL SELECT查询有什么问题?

时间:2015-12-08 10:41:16

标签: sql oracle

我正在尝试从表a获取所有信息,但收到错误:

  

ORA-00904:“A”:标识符无效。

这是我的疑问:

SELECT a
FROM FORMS a,
     APPLICATIONS b
WHERE b.APPLICATION_ID = a.APPLICATION_ID
  AND a.APPLICATION_ID = 14980

有什么问题?

1 个答案:

答案 0 :(得分:6)

SELECT a.* 
FROM FORMS a, APPLICATIONS b 
WHERE b.APPLICATION_ID = a.APPLICATION_ID AND a.APPLICATION_ID = 14980;

最好使用新语法:

SELECT a.*
FROM FORMS a JOIN APPLICATIONS b ON b.APPLICATION_ID = a.APPLICATION_ID 
WHERE a.APPLICATION_ID = 14980;