jmaccs64 Posted September 17, 2006 Share Posted September 17, 2006 How would I have SQL subtract 1 from a certain field where a match is found? Link to comment https://forums.phpfreaks.com/topic/21078-mysql-operator-question-solved/ Share on other sites More sharing options...
fenway Posted September 17, 2006 Share Posted September 17, 2006 UPDATE yourTable SET yourField = IF( yourField = 'yourValue', yourField-1, yourField ) Link to comment https://forums.phpfreaks.com/topic/21078-mysql-operator-question-solved/#findComment-93683 Share on other sites More sharing options...
jmaccs64 Posted September 18, 2006 Author Share Posted September 18, 2006 Your the best Fenway! Link to comment https://forums.phpfreaks.com/topic/21078-mysql-operator-question-solved/#findComment-93796 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.