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 Quote 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. Quote 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 Quote 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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/204357-update-limit/#findComment-1071071 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.