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

The Archive Base Latest Questions

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

I want to compare twos rows from a query result, for instance, if 1st

  • 0

I want to compare twos rows from a query result, for instance, if 1st row is equal to 2nd Row.

Given a query of the form

SELECT * FROM table_name

if the query results 100 rows, then how do we compare each rows for equality. just i am curious about the sql server how it will implement. basically implementation of Distinct operator. just want to know the how the SQL server will implement in behind the process. as it will help to understand the concept more in clearer way.

  • 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:29:49+00:00Added an answer on May 28, 2026 at 8:29 am

    Simplest way the sql server may use – to compare hashes of whole rows:

    SELECT CHECKSUM(*)
    from YourTable
    

    or choosen columns

    SELECT CHECKSUM(col1, col2, col3)
    from YourTable
    

    and if checksums differ – the rows are differ, but if checksum match – it need to check more carefully over exact values of columns, but it will be more or less easier to filter out the results which checksums is not match.

    To check the candidates to duplicates:

    SELECT CHECKSUM(*)
    from YourTable
    GROUP BY CHECKSUM(*)
    HAVING COUNT(*) > 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want compare time of execution Post.all and SELECT * FROM posts (or some
I want to compare a date from a database that is between 2 given
I want to compare two arrays, one coming from a shoppingcart and the other
I want to compare and count rows in the same datatabe. myDataTable hours_id(PK) |
I want to compare two dates with time, I want all the results from
I want to compare content of 15 columns in two rows. I am using
i want to compare the date given with the current date and i want
I want to compare the todays date and other date coming from my database.
I want to compare between two dates. From both the dates, I am fetching
I want to compare the current value of an in-memory Hibernate entity with the

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.