How to compare the top two records using SQL?

devquora
devquora

Posted On: Dec 26, 2020

 

The SQL, to compare the top two records is as follows:

SELECT DISTINCT 
    A.id
FROM
    newtable A
INNER JOIN 
    newtable B ON A.id = B.id
WHERE
    A.valB = B.valB AND
    A.valC = B.valC 

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Error
    Whoops, looks like something went wrong.