專家多個列我有四個查詢:計數在一個查詢
查詢#1:
select
satisfaction_score,count(satisfaction_score) as Satisfaction_count
from j_survey_response
where satisfaction_score != 0
group by satisfaction_score
的輸出將是
satisfaction_score Satisfaction_count 1 5 2 8 3 97 4 329 5 859
查詢#2:
select
response_score,count(response_score) as response_count
from j_survey_response
where response_score != 0
group by response_score
輸出
response_score response_count 1 28 2 8 3 42 4 250 5 980
查詢#3:
select
responder_score,count(responder_score) as responder_count
from j_survey_response
where responder_score != 0
group by responder_score
OUTPUT
responder_score responder_count 1 24 2 3 3 30 4 236 5 987
查詢#4:
select
service_score,count(service_score) as service_count
from j_survey_response
where service_score != 0
group by service_score
OUTPUT
service_score service_count 1 22 2 2 3 34 4 270 5 966
但我需要的輸出如下
score satisfaction_count response_count responder_count service_count 1 5 28 24 22 2 8 8 3 2 3 97 42 30 34 4 329 250 236 270 5 859 980 986 966
你能不能告訴我們一些示例表中的數據以及試試這個SQL查詢
? – jarlh