About 335,000 results
Open links in new tab
  1. sql - How do I use ROW_NUMBER ()? - Stack Overflow

    Jun 7, 2009 · SQL Row_Number () function is to sort and assign an order number to data rows in related record set. So it is used to number rows, for example to identify the top 10 rows which have the …

  2. sql - Using ROW_NUMBER () function in WHERE clause - Stack Overflow

    I found one question answered with the ROW_NUMBER() function in the where clause. When I tried one query, I was getting the following error: Msg 4108 Level 15 State 1 Line 3 Windowed functions can...

  3. sql - O que é ROW_NUMBER? - Stack Overflow em Português

    Aug 29, 2017 · O que é ROW_NUMBER usado no sql server? Como e onde devemos utiliza-lo? Tem um exemplo simples de uso ?

  4. Equivalent of Oracle's RowID in SQL Server - Stack Overflow

    Aug 4, 2009 · Stephanie: the assumption is that there is a unique key in the data, which assumes the data is normalized, which is an incorrect assumption sometimes. Thus, what's the equivalent to …

  5. sql - Why does using "where rownum = 1" not select the first ordered ...

    To give more details, the ROWNUM are assigned before any order is given to the result set. If you really want to get the correct result using the ROWNUM keyword, then you could achieve this with a …

  6. sql server - SQL RANK () versus ROW_NUMBER () - Stack Overflow

    I'm confused about the differences between these. Running the following SQL gets me two idential result sets. Can someone please explain the differences? SELECT ID, [Description], RANK() O...

  7. sql - How to use Oracle ORDER BY and ROWNUM correctly? - Stack …

    Feb 26, 2013 · The where statement gets executed before the order by. So, your desired query is saying " take the first row and then order it by t_stamp desc ". And that is not what you intend. The subquery …

  8. Add a row number to result set of a SQL query - Stack Overflow

    Jun 29, 2015 · I have a simple select statement. I want to add a temporary column that will represent number the of rows in my result set. I tried this - declare @num int set @num = 0; select t.A, t.B, t.C, …

  9. How to get the max row number per group/partition in SQL Server?

    I'm using SQL Server 2005. I have a payments table with payment id's, user id's, and timestamps. I want to find the most recent payment for each user. This is easy to search and find an answer for....

  10. sql server - row_number () Group by? - Stack Overflow

    Sep 21, 2012 · This is what I want my result set to look like: By using the SQL query below, I'm able to get row using the row_number() function. However, I can't get that unique column that I have …