返回與組1點多行的問題,請幫忙解決什麼是錯我的查詢下面我得到「子查詢返回多個1行」子查詢由
select
count(*) NONGENACC, AFFILIATE,
(SELECT COUNT(ACCOUNTNO) from realdb.tbl_logs GROUP BY AFFILIATE)AS ALLACCS
FROM realdb.tbl_logs
where LASTDATE <> CURDATE() group by AFFILIATE
返回下面當我走在GROUP BY從子查詢這不是我想要在allacs領域。請幫助...
NONGENACC AFFILIATE ALLACCS
1 ECOCBFBF 1481
2 ECOCBIBI 1481
13 ECOCBJBJ 1481
11 ECOCCDKI 1481
3 ECOCCFCF 1481
嗨,你可以創建[sql小提琴](http://sqlfiddle.com/)並告訴我們你期望的結果從查詢中獲取? –