Q:

How to select first value - SQL Server

I want to select the first date for each invoice as you can see below:
This is my data:
EC_Refpiece | EC_Date
FA0001      | 01/01/2019
FA0001      | 25/08/2018
FA0002      | 12/01/2019
FA0002      | 15/04/2017

And this is the result I want :
EC_Refpiece | EC_Date
FA0001      | 25/08/2018
FA0002      | 15/04/2017

A:

I think this should do the job:
SELECT EC_Refpiece, MIN(EC_date)
FROM table
GROUP BY EC_Refpiece

