I have as exemple these values into my database:
ruiter paard punten
1 1 2
1 1 10
2 1 4
1 1 10
i want the second highest value of "punten" grouped by ruiter and paard
this is what i have got so far:
SELECT u.ruiter,u.paard,(SELECT max(TOP 2 punten) FROM uitslag where ruiter = u.ruiter and paard = u.paard) AS points1 FROM uitslag u group by u.ruiter,u.paard"
when i put this code into my asp.net page i get errors
Someone any ideas how i can fix this??
When i can get it to work for the second highest value. I then can work further for the third, fourth,... highest value.
tnx alot
PhilippeUse Query Analyser, that SQL just isn't SQL. It will give you better hints as to why it's wrong
No comments:
Post a Comment