CodeIgniter Forums
SQL version 4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: SQL version 4 (/showthread.php?tid=41346)



SQL version 4 - El Forum - 05-05-2011

[eluser]sudinem[/eluser]
I have a sql query which works fine on Mysql server version 5 like this:

Code:
SELECT max( cnt ) AS max_no_rows
FROM (

SELECT event_card, count( time ) cnt
FROM detail_attendance
WHERE date = '2011-01-02'
GROUP BY event_card
) AS T

but this does not works in mysql version 4...How to restructure the query for version 4