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

  • Home
  • SEARCH
  • 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
  • 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-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

I am using SQL server 2005. I have a table like this - ID
I have a query: SELECT t.*, tb.UpdateDate FROM #tempBuildings tb INNER JOIN Buildings b
I have a datecolumn called invoicedate, my query is: select MONTH(dbo.tblInvoices.InvoiceDate) as datemonth, Year(dbo.tblInvoices.InvoiceDate)as
Hi I have an App which works with a DB. And I have one
Possible Duplicates: Simulating group_concat MySQL function in MS SQL Server 2005? Concat groups in
I've got an application witch uses NHibernate as an ORM. I have one persistent
I need to join a table on itself while joining other tables and doing
I have asked a couple of questions on here in a rush, and I
The reason I ask it we have a dedicated RAID10 array with ~150GB for
I need to calculate sum of occurences of some data in two columns in

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.