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 6116351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:11:47+00:00 2026-05-23T15:11:47+00:00

I have one query in SQL Server output, Suppose i have one table (Ex.StudentMaster)

  • 0

I have one query in SQL Server output,

Suppose i have one table (Ex.StudentMaster) having some fields-No unique constraints.
For Ex. RollNumber and Name
The table has same same data. For ex:

RollNo      Name
    1       Yoko
    1       Yoko
    1       Yoko

I want to get only third record. How can i identify this unique record?

  • 1 1 Answer
  • 1 View
  • 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-23T15:11:47+00:00Added an answer on May 23, 2026 at 3:11 pm

    Any row is a third row 🙂

    create table test
    (
    n int,
    name varchar(30)
    );
    
    insert into test values(1,'yoko'),(1,'yoko'),(1,'yoko');
    
    select ROW_NUMBER() over(order by name) as ordinal, * from test;
    

    Deleting the “third” row 🙂

    with a as
    (
    select ROW_NUMBER() over(order by name) as ordinal, * from test
    )
    delete from a where a.ordinal = 3
    

    Deleting the last row:

    with a as
    (
    select ROW_NUMBER() over(order by name) as ordinal, * from test
    )
    delete from a where a.ordinal = (select MAX(ordinal) from a)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're using SQL Server 2000 Query Analyser, and one issue we have is that
I have some varbinary data stored in a table in MS Sql Server 2005.
I have a sql query that runs super fast, around one second, when not
Right now, I have a SQL Query like this one: SELECT X, Y FROM
I have a query that pulls up questions from one table and answers from
I have a SQL Server DB containing a registrations table that I need to
I am using SQL server 2005. I have a table like this - ID
I'm having some trouble writing a query. For example: Let's say I have just
I have a Sql Server 2K8 R2 DB with a table that have a
I have one query on which I would like to get your valuable feedback.

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.