自己在修改運用.. SELECT (s1.c - s2.c) AS c, s1.a AS 's1-a', s1.b AS 's1-b',...
感覺上 用JOIN就可以解決的式子 SELECT a.sqid , a.s1, a.s2, a.s3, b.s1, b.s2, b.s3, a.s1-b.s1...
CREATE TABLE a ( sqid INT, s1 decimal(12,2), s2 decimal(12,2), s3 decima...
可能要加上條件判斷 select (a.s1-b.s1) as s1相減 from a as a,b as b where a.sqid=b.sqid