Skip to content
Advertisement

Return first date and previous dates

There is a custid with 3 dates .

I want to return first date and then its previous date .

data should look like:

I have done it but I’m not able to put it in 2nd row.

Output which I’m getting:

I want it to look like:

Advertisement

Answer

You don’t need to add the 3rd inner join table. Since your using min() with other columns, this should be accompanied by Group By.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement