Answer the question
In order to leave comments, you need to log in
How to select 2 values from 2 parameters and display them on 1 line?
Good day, how can I get 2 parameters in 1 request and display their values on 1 line?
SELECT user.id, user.nickname, stat.param, stat.value FROM saved_users_stats AS stat
JOIN saved_users AS user ON userId = id
WHERE param = "[difficulty]chernobylhard [mode]PVE [stat]player_sessions_won" ORDER BY value DESC LIMIT 50
Answer the question
In order to leave comments, you need to log in
Making a PIVOT
select
user_id,
sum(case when param = 'Won' then value else 0 end) 'Won',
sum(case when param = 'Lose' then value else 0 end) 'Lose'
from user_stats
where param in ('Won', 'Lose')
group by user_id;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question