just i would like to ask how can i detect the first record, and last record in mysql table? in msaccess it's simply movefirst or movelast how to do that in mysql. thanks
Could you use LIMIT 1 to get the first record? SELECT * FROM MyTable Where MyField > "" ORDER BY MyIndex LIMIT 1; Code (markup): Could you use LIMIT 1 in combination with DESC to reverse the sort order and get the last record? SELECT * FROM MyTable ORDER BY MyIndex DESC LIMIT 1; Code (markup):