Skip to content
Advertisement

Trying to show dates of MIN and MAX values of each customers on DB BROWSER for SQLITE

On this data table I’m trying to query dates of MIN and MAX values on SQLite

Output should look like this

This is what I have done so far;

so I can get the date of max but somehow I need to save this date as DATE_OF_MAX and repeat this for MIN and inner select them or create two separate tables and combine them? This is where I got stuck.

Advertisement

Answer

The simplest way is with FIRST_VALUE() window function:

See the demo.
Results:

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