ashkumar
Fri 4th Jul '03, 5:54am
Hi All,
I am new to mySql and I am struggling get one query running. The query is =>
SELECT A.memberno, A.title, A.firstname, A.lastname, A.expiry, A.email, count(*) as count_port FROM member A, portfolio_assessor B WHERE A.memberno = B.memberno and B.status != '3' and A.status = '3' GROUP BY A.memberno ORDER BY count_port, A.memberno
It works fine if the second table "portfolio_assessor" assesor has few corresponding records to first table "member". But I am struggling to get it to show records from first table with count(*) as 0, when there are no corresponding records in 2nd table.
Please help me. I've already lost all my hair over it in last couple if hours. Any help will be really appreciated.
Best Regards,
Ash
I am new to mySql and I am struggling get one query running. The query is =>
SELECT A.memberno, A.title, A.firstname, A.lastname, A.expiry, A.email, count(*) as count_port FROM member A, portfolio_assessor B WHERE A.memberno = B.memberno and B.status != '3' and A.status = '3' GROUP BY A.memberno ORDER BY count_port, A.memberno
It works fine if the second table "portfolio_assessor" assesor has few corresponding records to first table "member". But I am struggling to get it to show records from first table with count(*) as 0, when there are no corresponding records in 2nd table.
Please help me. I've already lost all my hair over it in last couple if hours. Any help will be really appreciated.
Best Regards,
Ash