in reply to Re: Can this be done entirely in MySQL?
in thread Can this be done entirely in MySQL?

If you have an index you can do this without the subselect.

You can use ignore index if you want the natural order, but the you can't currently create a descending index.

create index registrants_lname_asc on registrants (lname ASC); SET @rownum := 0 SELECT CONCAT(min(@rownum := @rownum + 1), '-', max(@rownum), ' (', min(lname), '-', max(lname), ')') from registrants use index (registrants_lname_asc) group by floor(@rownum/100)
-- gam3
A picture is worth a thousand words, but takes 200K.