我是MariaDb的新手,我的查询错误。
SELECT C.NUMASE,
(SELECT SUM(B.TIPUS) AS TOT
FROM (
SELECT A.NUMASE, CASE WHEN A.TIVA IS NULL THEN 1 ELSE 0 END AS TIPUS
FROM CONTA_001_CAS00118 as A
WHERE C.NUMASE = A.NUMASE and IFNULL(A.SR_DELETED,' ') <> 'T'
) AS B
) AS SUMT
FROM (
SELECT DISTINCT NUMASE
FROM CONTA_001_CAS00118
WHERE IVA IS NOT NULL and IFNULL(SR_DELETED,' ') <> 'T'
) AS C
错误是:
错误de SQL(1054):未知列C.NUMASE in&#39; where clausule
任何人都可以帮助我吗?
谢谢 彼得。