Is it possible for a subquery to return two values?
问题 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? 回答1: If you use the subquery in the FROM clause rather than the field list, then you can treat the output as a table and refer to the separate columns. 回答2: You are just selecting numbers as results so couldn't you just do: SELECT 1, COUNT(*), MAX(*) FROM test_table WHERE test=123 回答3: Not