How do I use ROW_NUMBER()?

For the first question, why not just use? SELECT COUNT(*) FROM myTable to get the count. And for the second question, the primary key of the row is what should be used to identify a particular row. Don’t try and use the row number for that. If you returned Row_Number() in your main query, SELECT … Read more