Welcome Guest, Not a member yet? Register   Sign In
mysql help
#1

[eluser]quasiperfect[/eluser]
how can i add from mysql a incrementing value to each row i get from a query ?
i'm not talking about auto incrementing a existing value.

example :
Quote:select round((sum(votes.vote) / count(votes.id)),2) AS vote, count(votes.id) AS nrvotes, ("value"+1) as position FROM votes, users WHERE users.id = votes.person order by vote,nrvotes,position desc

where "value" is not in any of the 2 tables is just the place in the results

this is just a example my query is much more complex

i want to add a value starting from 1 an incrementing it for each row.
i need to do this from inside the query not from php


Messages In This Thread
mysql help - by El Forum - 05-22-2009, 12:51 PM
mysql help - by El Forum - 05-22-2009, 06:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB