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 Quote 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 Quote 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.... Quote 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 Quote 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..... Quote 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 Quote 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. Quote 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 Quote 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; Quote Link to comment https://forums.phpfreaks.com/topic/74702-solved-calculatesum/#findComment-378059 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.