Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7093267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:25:04+00:00 2026-05-28T08:25:04+00:00

i never use sql server ROW_NUMBER() function. so i read some article regarding ROW_NUMBER(),PARTITION

  • 0

i never use sql server ROW_NUMBER() function. so i read some article regarding ROW_NUMBER(),PARTITION & RANK() etc but still not clear to me.

i found the syntax is like

SELECT top 10 ROW_NUMBER() OVER(ORDER BY JID DESC) AS 'Row Number',
JID,Specialist,  jobstate, jobtype FROM bbajobs

SELECT top 10 ROW_NUMBER() OVER(PARTITION  BY JID ORDER BY JID DESC) AS 'Row Number',
JID,Specialist,  jobstate, jobtype FROM bbajobs

i have few question

1) what over() function does. why we need to specify column name in over function like OVER(ORDER BY JID DESC)

2) i saw sometime people use PARTITION  keyword. what it is?
it is also used in over function like OVER(PARTITION  BY JID ORDER BY JID DESC)
3) in what type of situation we have to use PARTITION  keyword
4) when we specify PARTITION  keyword in over then also we need to specify order by    also why. only PARTITION  keyword can not be used in over clause.
5) what type of situation one should use RANK function
6) what is CTE and what is the advantage of using CTE. it is just like temporary view.
anyone get any performance boost if he/she use CTE other than reusability?

please discuss my points in detail. it will be very much helpful if some one make me understand with small & easy example for all the keyword like ROW_NUMBER(),PARTITION & RANK(). thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:25:05+00:00Added an answer on May 28, 2026 at 8:25 am
    • OVER Clause (Transact-SQL)

    • Ranking Functions (Transact-SQL)

    • ROW_NUMBER (Transact-SQL)

    • RANK (Transact-SQL)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read somewhere that one should never use error conditions as normal program flow.
I've been using user controls extensively but never use a HttpHandler and was wondering
So I've tried to work with the pure-CSS, never-use-tables-for-layout gospel, I really have. But
I have a report in SQL Server Reporting Services 2005. It makes use of
In my SQL statement I use wildcards. But when I try to select something,
We use LINQ to Entities to write entries into an Audit database (SQL Server
I'm familiar with SQL Server Indexed Views (or Oracle Materialized Views), we use them
I am attempting to use the SQL SERVER 2008 MERGE statement in a stored
I use SQL Server 2008 Express with Advanced Services. I have a view: IF
I'm trying to use the Entity Framework 4.1 RC with a SQL Server 2005

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.