我正在尝试此代码。
SELECT COUNT(SELECT COUNT(postnID) AS Total,
postnID, Unit_DBM, job_type,
level, internal_plantilla, INCID,
ITEM_NO_2005, position_type,
position_status
FROM plantilla
GROUP BY internal_plantilla, level, INCID, postnID, position_status
ORDER BY internal_plantilla, postnID) as num
FROM plantilla
但是在mysql中有错误。如何在选择计数内执行选择计数?
答案 0 :(得分:0)
你可以做:
SELECT COUNT(*) from (SELECT COUNT(postnID) AS Total,
postnID, Unit_DBM, job_type,
level, internal_plantilla, INCID,
ITEM_NO_2005, position_type,
position_status
FROM plantilla
GROUP BY internal_plantilla, level, INCID, postnID, position_status
ORDER BY internal_plantilla, postnID) as num