Reputation: 641
I can't seem to get this output of selecting all except the first one to work with "OFFSET". This is the one suggested as I googled
SELECT merchantid, upload_num, photosrc FROM clinics_images
WHERE merchantid = 3
OFFSET 1 ROWS
Error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'OFFSET 1 ROWS LIMIT 0, 25' at line 3
Any alternativesto put in the SQL for this to work?
Upvotes: 2
Views: 2064
Reputation: 204746
Your error indicates that you use
OFFSET 1 ROWS LIMIT 0, 25
to get 25 records skipping the first one. The correct syntax is
SELECT merchantid, upload_num, photosrc
FROM clinics_images
WHERE merchantid = 3
LIMIT 25 OFFSET 1
or shorter
LIMIT 1, 25
Upvotes: 4