我有一個快速的問題,我無法找到答案。如何加入/聯合查詢
(SELECT Student_Name AS 'First two from Quiz' FROM events WHERE Event_Name LIKE 'Quiz' ORDER BY Student_Name LIMIT 2)
UNION ALL
(SELECT Student_Name as 'Last two from Quiz' FROM (SELECT Student_Name FROM events WHERE Event_Name LIKE 'Quiz' ORDER BY Student_Name DESC LIMIT 2) as q ORDER BY Student_Name)
UNION ALL
(SELECT Student_Name as 'Last two from Sqlizer' FROM (SELECT Student_Name FROM events WHERE Event_Name LIKE 'Sqlizer' ORDER BY Student_Name DESC LIMIT 2) as w ORDER BY Student_Name)
UNION ALL
(SELECT Student_Name AS 'First two from Sqlizer' FROM events WHERE Event_Name LIKE 'Sqlizer' ORDER BY Student_Name LIMIT 2)
這是我的一個小代碼。我需要把它們展示給另一個人。就像旁邊的一個一樣。由於所有工會都顯示在一列中。你有解決這個問題的想法嗎?請,這是時間問題。我想在2小時內完成它。
你能不能改一下你的問題嗎?可能的話,預期的產量和實際可能會有所幫助 – FieryCat
這是沒有必要的。問題已經被解決 –