robert_gsfame Posted June 10, 2010 Share Posted June 10, 2010 i have problem with this query UPDATE table1 SET column1='test' WHERE column1 IS NULL LIMIT 20 OFFSET 21 this will cause error...how can i make this query work.. I wish to update table and as i dont have anything such as id to be used as ORDER BY so i use OFFSET Link to comment https://forums.phpfreaks.com/topic/204357-update-limit/ Share on other sites More sharing options...
fenway Posted June 10, 2010 Share Posted June 10, 2010 What's OFFSET? This isn't part of MySQL syntax. Link to comment https://forums.phpfreaks.com/topic/204357-update-limit/#findComment-1070322 Share on other sites More sharing options...
Mchl Posted June 10, 2010 Share Posted June 10, 2010 It is actually, http://dev.mysql.com/doc/refman/5.0/en/select.html although I think it can't be used in UPDATE http://dev.mysql.com/doc/refman/5.0/en/update.html Link to comment https://forums.phpfreaks.com/topic/204357-update-limit/#findComment-1070326 Share on other sites More sharing options...
fenway Posted June 12, 2010 Share Posted June 12, 2010 It is actually, http://dev.mysql.com/doc/refman/5.0/en/select.html although I think it can't be used in UPDATE http://dev.mysql.com/doc/refman/5.0/en/update.html No kidding -- postgres comparability, huh? You learn something new every day. And yes, you can use it with UPDATE, but it's really only meaningful with an ORDER BY. Link to comment https://forums.phpfreaks.com/topic/204357-update-limit/#findComment-1071036 Share on other sites More sharing options...
Mchl Posted June 12, 2010 Share Posted June 12, 2010 No kidding -- postgres comparability, huh? I think it's part of SQL:2008 It's not. OFFSET alone is, but not LIMIT ... OFFSET. Link to comment https://forums.phpfreaks.com/topic/204357-update-limit/#findComment-1071071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.