,使一行的結果顯示,而不是多行:SQL查詢組合成我有一些困難,結合以下查詢
SELECT value FROM dbo.parameter WHERE name='xxxxx.name'
SELECT dbo.contest.name AS Event_Name
FROM contest
INNER JOIN open_box on open_box.contest_id = contest.id
GROUP BY dbo.contest.name
SELECT COUNT(*) FROM open_option AS total_people
SELECT SUM(scanned) AS TotalScanned,SUM(number) AS Totalnumber
FROM dbo.open_box
GROUP BY contest_id
SELECT COUNT(*) FROM open AS reff
WHERE refer = 'True'
我想從顯示的字段數據在每一列中與下圖中顯示的相似。任何幫助表示讚賞!
這就像轉置的東西。你想要它多列還是隻有一個字段(串聯)? – DukeOfHazard
歡迎您通過展示您的預期結果模型來獲得更快的答案... – downwitch
對不起 - 應該顯示我想要的。我想多列,但所有的數據在一行 - 我需要能夠從一張表提取到一張新表 –