there are 2 tables
t1
- id name
- 1 aaa
- 2 bbb
- 3 ccc
t2
- id name
- 1 qwe
- 2 asd
- 3 zxc
you need to select everything by id key and so that t1.name becomes name1 and t2.name becomes name2
and to get
- id name1 name2
- 1 aaa qwe
- 2 bbb asd
- 3 ccc zxc
Source: https://ru.stackoverflow.com/questions/680539/
All Articles
SELECT * FROM t1,t2 WHERE t1.id=t2.id- Akinaselect t1.name as name1, t2.name as name2- Mike