> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/database/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/database/chapter1/12mysql-for-beginners/125using-joins-to-combine-tables/1253right-join.md).

# 1.2.5.3.Right join

* Right join displays common data from columns specified on both table with ON keyword along with all data from first table (right table) and lists out the columns as mentioned on select
* 以第二個table為主, 加入第一個table

```
select * from studentsdetails right join studentsbackup2 on studentsdetails.id = studentsbackup2.student_id;
```

![](https://1088158622-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G87SQJ28mvsXOhL%2F-M4M0IBPb1goOGpuG1BI%2F-M4M0LJmUDgcEadd2uas%2F2018041430.jpg?generation=1586302926073101\&alt=media)
