how to get Mysql COUNT within subquery -
here have table named test2. need below output single mysql query.i have tried using subquery fail. kindly me sort this.
pending status- 154
completed status - 159
required output
query have tried
select ( test2.doc_no, select ( count(test2.esn) pending_quantity, test2.doc_no test2 test2.sttus = 154 group test2.doc_no ), select ( count(test2.esn) completed_quantity, test2.doc_no test2 test2.sttus = 159 group test2.doc_no ) )
select doc_no, sum(status=154) pending_quantity, sum(status=159) completed_quantity test2 group doc_no
try above query.
hope you.
Comments
Post a Comment