下面的句子在sybase裡面運行是錯誤的......
SELECT COUNT(p03invnum) from
( SELECT p03shidat,p02subdat,p02setdat,p03invnum
from bip02,bip03
where p02comcod=p03comcod
and p02bilnum=p03bilnum);
------解决方案--------------------------------------------------------
SELECT COUNT(p03invnum) from
( SELECT p03shidat,p02subdat,p02setdat,p03invnum
from bip02,bip03
where p02comcod=p03comcod
and p02bilnum=p03bilnum) t;
加个别名试一下。
------解决方案--------------------------------------------------------
别名
------解决方案--------------------------------------------------------
SELECT COUNT(t.p03invnum) from
( SELECT p03shidat,p02subdat,p02setdat,p03invnum
from bip02,bip03
where p02comcod=p03comcod
and p02bilnum=p03bilnum) t;
把别名加上,并且引用别名.
------解决方案--------------------------------------------------------
as newname
------解决方案--------------------------------------------------------
xsbry已经说了,他的正确