※ 引述《JYHuang (夏天到了,冷不起來了說)》之銘言:
: 其本上是分兩次查詢就可以完成
: select count(*) from table
: select count(*) from table where xxx group by xx
: 那要怎麼一次查詢就把兩種資料取出來呢?
select a.*, (select count(1) from table) from
(
select id, count(1) from table where .... group by id
)
如此即可
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.167.210.145