Quick SQL Question

Hi I have a query that I am attempting to execute. If you could help me that would be awesome!

I am trying to return the min date from a, min date from b and min date from c. So this example would return 3 rows in total that contain a, b and c.

Table example:

      Row 1    Row 2        
        Date        a
        Date        a
        Date        a
        Date        b
        Date        b
        Date        b
        Date        c
        Date        c
        Date        c

Let me know what my best options are.

Thank you!

SELECT [Row 2], MIN([ROW 1]) AS MinDate
FROM [Table example]
GROUP BY [Row 2];

You can search for "sql aggregate functions" for examples.

1 Like