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 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 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 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 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 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 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 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 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 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.