-2

have a comments table and need to get the first comment date (first inserted record) of each users in the table.

Output will be :

user_id   first_comment_date
waleedazam
  • 357
  • 2
  • 12

1 Answers1

3

You can use min() try

SELECT user_id, MIN(comment_date) 
FROM commentstable 
GROUP BY user_id;
JavaLearner
  • 215
  • 3
  • 8