查询是获取每个表的日期,我已经检查了我的代码,但它仍然是错误的“每个派生表必须有自己的别名错误”
SELECT T.*
FROM (
SELECT DISTINCT(DATE_FORMAT(p.deliverDate, '%M')) as PDate
FROM piglet_po p
WHERE p.raiserID = '0025' AND p.rotationNo = '3'
AND p.deliverDate NOT IN
( SELECT DISTINCT(DATE_FORMAT(f.issuedDate, '%M')) as FDate
FROM feed_slip f
WHERE f.raiserID = '0025' AND f.issuedDate BETWEEN '2012-06-01' AND '2012-11-01'
AND f.issuedDate NOT IN
( SELECT DISTINCT(DATE_FORMAT(v.issuedDate, '%M')) as VDate
FROM vet_slip
WHERE v.raiserID = '0025' AND v.issuedDate BETWEEN '2012-06-01' AND '2012-11-01'
AND v.issuedDate NOT IN
( SELECT DISTINCT(DATE_FORMAT(w.issuedDate, '%M')) as WDate
FROM weight_slip w
WHERE w.raiserID = '0025' AND w.issuedDate BETWEEN '2012-06-01' AND '2012-11-01'
)
)
) T