-
-
Notifications
You must be signed in to change notification settings - Fork 297
/
Copy path618.cpp
41 lines (22 loc) · 838 Bytes
/
618.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
__________________________________________________________________________________________________
select America,Asia, Europe from
(
select @row_id:=@row_id+1 as row_id, name as America
from student, (select @row_id:=0) r
where continent = 'America'
order by name
) ame
left join (
select @row_id:=@row_id+1 as row_id, name as Asia
from student, (select @row_id:=0) r
where continent = 'Asia'
order by name
) asi on ame.row_id = asi.row_id
left join (
select @row_id:=@row_id+1 as row_id, name as Europe
from student, (select @row_id:=0) r
where continent = 'Europe'
order by name
) eur on eur. row_id = ame.row_id
__________________________________________________________________________________________________
__________________________________________________________________________________________________