-1
I have a basis that I need one of the columns to be the search for the lowest date recorded on that CPF/CNPJ in the base.
In the example would create the column data_anterior
:
cpf_cnpj | aplicado| data_aplic | data_anterior ------------------------------------------------- 123456789 | sim | 22/03/2018 | missing 123456789 não | missing | 22/03/2018
When the date is the same as data_aplic
the information must not appear.
Can you help me program this function in SQL
?
Could you explain what you need better? Questions: (1) which column you refer to in "I need one of the columns"? (2) on "the search for the shortest date recorded", in which column the earliest date? (3) on "the information must not appear", row should be deleted or column?
– José Diz