> For the complete documentation index, see [llms.txt](https://chiu-kuohsin.gitbook.io/leetcode-database-solution-with-hive-sql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chiu-kuohsin.gitbook.io/leetcode-database-solution-with-hive-sql/exercise-8-618.students-report-by-geography/hive-solution.md).

# Hive Solution

## 3.Hive Solution

```sql
SELECT america,asia,europ
FROM 
(select name as america ,row_number()over() as id from leetcode.ex_618_student 
 	where continent = 'America' order by America) a 
full join 
(select name as asia ,row_number()over() as id from leetcode.ex_618_student 
 	where continent = 'Asia' order by Asia) b on a.id=b.id
full join 
(select name as europe ,row_number()over() as id from leetcode.ex_618_student 
 	where continent = 'Europe' order by Europe) c on a.id=c.id
 	;
```
