我们正在尝试编写一个向我们展示的查询:
收入最高和最低的计划并打印其帐户健康状况
这是我们必须开始的:
最佳
选择TOP 5 *来自健康,收入来自……
你要 UNION ALL :
UNION ALL
Select TOP (5) AT.Health, PT.Revenue From Program_T PT INNER JOIN Account_T AT ON PT.AccountName = AT.AccountName Order by Revenue LIMIT 5 UNION ALL Select TOP (5) AT.Health, PT.Revenue From Program_T PT INNER JOIN Account_T AT ON PT.AccountName = AT.AccountName Order by Revenue DESC LIMIT 5;