DarkPrince2005 Posted October 25, 2007 Share Posted October 25, 2007 I have an integer field with a number in it, does anyone know what the correct syntax would be to add 1 to the number of that field, I thought the syntax would look something like: Select User, Number, (Number+1) from Users; I have tried a various combinations of what it might look like but nothing seems to work Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/ Share on other sites More sharing options...
Zane Posted October 25, 2007 Share Posted October 25, 2007 SELECT user, num, SUM(number, 1) as num2 from users Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-377654 Share on other sites More sharing options...
clearstatcache Posted October 25, 2007 Share Posted October 25, 2007 you sure this won't work? ==>> Select User, Number, (Number+1) from Users; it seems to work on me.... Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-377695 Share on other sites More sharing options...
Zane Posted October 25, 2007 Share Posted October 25, 2007 if it works for you, then what's the question I'm sure what I gave you will work though Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-377697 Share on other sites More sharing options...
clearstatcache Posted October 25, 2007 Share Posted October 25, 2007 i dunno zanus....DarkPrince posted it..... Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-377699 Share on other sites More sharing options...
Zane Posted October 25, 2007 Share Posted October 25, 2007 oops sorry...didn't even look at the poster name it's too early for me I'm pretty sure though that this Select User, Number, (Number+1) from Users; isn't the correct syntax...........for addition in SQL Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-377700 Share on other sites More sharing options...
fenway Posted October 25, 2007 Share Posted October 25, 2007 SELECT user, num, SUM(number, 1) as num2 from users SUM doesn't take a second argument. Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-378028 Share on other sites More sharing options...
Zane Posted October 25, 2007 Share Posted October 25, 2007 man, .... I'm not on my game today sorry guys fenway's right Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-378036 Share on other sites More sharing options...
rajivgonsalves Posted October 25, 2007 Share Posted October 25, 2007 no problem zanus anyways the following should work fine Select User, Number, (Number+1) from Users; Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-378059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.