Find the first key by date field using sql and output also have other fields
问题 I want to query the first occurrence of every name according to the earliest date. The output should have the complete row. Please help me to write the query in sql. Input: Name | ID | payment_date | Pack ------+-------+-----------------+------- A | 11 | 31-Jan | P C | 13 | 31-Jan | Q B | 2 | 31-Jan | R C | 3 | 28-Jan | P D | 23 | 29-Jan | Q B | 11 | 30-Jan | R A | 17 | 25-Jan | P C | 13 | 26-Jan | Q D | 17 | 2-Feb | R B | 23 | 3-Feb | P A | 45 | 4-Feb | Q B | 3 | 5-Feb | R Output: Name | ID