Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Simon_Test1
#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 SO46102892; Create table SO46102892 ( cat int, score int); insert into SO46102892 values (1, 2); insert into SO46102892 values (1, 3); insert into SO46102892 values (2 , 1); insert into SO46102892 values (2, 3); insert into SO46102892 values (2, 5); insert into SO46102892 values (3, 1); insert into SO46102892 values (3, 2); insert into SO46102892 values (3, 3); insert into SO46102892 values (3, 4); SELECT A.cat, Min(A.score) score1, min(B.Score) score2 FROM SO46102892 A INNER JOIN SO46102892 B on A.cat = B.Cat and A.score < B.Score GROUP BY a.cat;
run
|
edit
|
history
|
help
0
..
lab01
Create database sneha;
exp11
Dx
pets
Srr
MySQL Practice
grre
ventas