我在使用join命令时遇到问题。我有这个:
create view NDX100PLUS as
(select A.*, (A.index_value-B.index_value) as Change
from NDX100 as A join NDX100 as B
on A.id=(B.id-1));
基本上创建一个视图,其中一列是两个index_values的日内更改。但它不断产生错误:
错误1064(42000):您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在
附近使用正确的语法'Change from NDX100 as A join NDX100 as B on A.id=(B.id-1))'
第2行
我不知道这意味着什么,应该使用的语法(?)然后我尝试了这个:
create view NDX100PLUS as
(select A.*, (A.index_value-B.index_value) as Change
from NDX100 as A,NDX100 as B
where A.id=(B.id-1));
但它会产生相同的错误。任何人都可以帮忙吗?这非常令人沮丧。