SQL Duplicated Records
Budget: $10 – $30 USD
There are more than 10k sql records and some records are duplicated i want to learn which records duplicated regarding below conditions
Conditions
If row1.column1 = row2.column1
and
row1.column2 = row2.column2
and
row1.column3 = row2.column3
and
row1.column4 – row2.column4 <= 95 days
and
row1.column5/row2.column5 <= 1,5
TABLE
Column1 | column2 | column3 | column4 | column5
Row1 | 8800 | pencil | 1234 | 2022-05-05 | -658
Row 2 | 8800 | pencil | 1234 | 2022-04-05 | -655
Row 3 |8800 | pencil | 1234 | 2021-04-05 | -650
RESULT
Row1 | 8800 | pencil | 1234 | 2022-05-05 | -658
Row 2 | 8800 | pencil | 1234 | 2022-04-05 | -655
Conditions
If row1.column1 = row2.column1
and
row1.column2 = row2.column2
and
row1.column3 = row2.column3
and
row1.column4 – row2.column4 <= 95 days
and
row1.column5/row2.column5 <= 1,5
TABLE
Column1 | column2 | column3 | column4 | column5
Row1 | 8800 | pencil | 1234 | 2022-05-05 | -658
Row 2 | 8800 | pencil | 1234 | 2022-04-05 | -655
Row 3 |8800 | pencil | 1234 | 2021-04-05 | -650
RESULT
Row1 | 8800 | pencil | 1234 | 2022-05-05 | -658
Row 2 | 8800 | pencil | 1234 | 2022-04-05 | -655