Can we use Select statement inside a loop in a Mysql Stored Procedure?
why is the code wrong
create procedure AbsentReportproc (INOUT fromdate DATET
You didn't need a loop for this. You can do so:
SELECT p.CARDNO, COUNT(CARDNO) AS countdate FROM test_prefixmaster p INNER JOIN test_prefixtransactions t ON p.CARDNO = t.CARDNO WHERE Date(t.S_DateTime) BETWEEN fromdate AND todate GROUP BY p.CARDNO;