0
我有兩張表,seet和費用,我需要選擇從費用中支付的總額並從支付中減去它。從兩個表中減去派生列
我試了下面的查詢,任何人都可以糾正它嗎?
我得到這個錯誤:
every derived table must have its own alias
SELECT (payable - pay) as balance
FROM (SELECT sum(paid) AS pay
FROM fees
WHERE adm = '5685')
UNION ALL
SELECT payable
FROM seet
WHERE term = 'term1')
)as t1
它的工作...謝謝 –