[英]SELECT COUNT inside SELECT COUNT
I am trying this code. 我正在尝试此代码。
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
But having error in mysql. 但是在mysql中有错误。 How can I perform select count inside a select count?
如何在选择计数内执行选择计数?
you can do by: 您可以通过以下方式做到:
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.