0
I have two TB1 and TB2 tables with equal fields in order to compare the records.
The logic is: Query the records contained in TB1, but not contained TB2, considering 3 fields: code, date and value. Because the code can repeat itself but date and value vary, so I need to compare the record as a whole.
Soon:
SELECT CODIGO, DATA, VALOR
FROM TB1
EXCEPT
SELECT CODIGO, DATA, VALOR
FROM TB2
However, I need to create a condition/clause so that it does not return records whose difference in value is = 1
TAB1:
Codigo: 001 Data: 02/02/2019 Valor: 224
TAB2:
Codigo: 001 Data: 02/02/2019 Valor: 223
Resultado: Não deve retornar nenhum registro. Pois 224 - 223 = 1.
Updated response.
– rbz