Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Build table horizontally
#MySQL 5.7.12 #please drop objects you've created at the end of the script #or check for their existance before creating #'\\' is a delimiter #MySQL 5.7.12 #please drop objects you've created at the end of the script #or check for their existance before creating #'\\' is a delimiter drop table if exists simon; Create table simon ( userId int, passageId int, score int); INSERT INTO simon (userId , passageId , score ) VALUES (10, 1, 2), (10, 1, 3), (10, 2, 1), (10, 2, 3), (10, 2, 5), (11, 1, 1), (11, 2, 2), (11, 2, 3), (11, 3, 4); select * from simon /* SELECT A.userId, A.passageId, Min(A.score) score1, min(B.score) score2 FROM simon A INNER JOIN simon B on A.userId = B.userId and A.passageId = B.passageId and A.score < B.Score GROUP BY a.passageId; */ /* userId passageId score1 score2 10 1 2 3 10 2 1 3 11 1 1 null 11 2 2 3 11 3 4 null */
run
|
edit
|
history
|
help
0
Legitimate Resale
MySQL updates first timestamp column automatically
MySQL JSON_SEARCH boolean Issue
poi
GROUP_CONCAT Mysql
farmaciacarnaru
Aditya
Srinivas
Dx
sunil