• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

SQL Capabilities Question

Magic2K2

New Member
Let's say I execute a query that returns 200 results. Each row in the result contains a primary field called "player_id". Now, for example, I want to find out which row player_id = 123. Can SQL tell me if that player_id is in the 10th, 20th, or whatever row? I know I could do a loop and count it myself, but I'd rather this shortcut if its possible.
 
I don't understand your question fully.

You could use SELECT * FROM table WHERE player_id = 133, but I'm not sure that's what you're looking for.
 
This works in MS-SQL:

select @@ROWCOUNT, * from TableName

.. where the first column would hold an incrementing row count for the respective record.

Hope it help!
 
It's not a standard part of SQL, but many SQL servers support it. What are you using? MySQL?
 
Back
Top