【发布时间】:2018-11-28 21:17:12
【问题描述】:
我正在尝试以下方法:
select sum(a.shares*a.cps) - sum(b.shares*b.cps) from
(select * from transactions
where usr = 1
and type = "C"
or type = "S") as a
union
(select * from transactions
where usr = 1
and type = "W"
or type = "B") as b
然后回来:
Error: Syntax error: Encountered "as" at line 10, column 40.
【问题讨论】:
-
另外,删除
as a和as b,因为它们没有任何作用。