I have a table T with columns X, Y and Z. I need to retrieve non-group by column X value of the first row of every group, group by column Y value, and MIN of column Z value in a SQL single query.
Please could you help me out.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve assumed that you’ve got a column x_dt that can be used to determine the first row of a Y group.