Is it possible for a subquery to return two values onto the outer query?
Such as:
SELECT 1,
(SELECT COUNT(*), MAX(*) FROM test_table WHERE test=123)
FROM another_table
Or is there a better way to do this?
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.
If you use the subquery in the
FROMclause rather than the field list, then you can treat the output as a table and refer to the separate columns.