我在同一个表中有以下列
Column 1
--------
1
2
3
Column 2
--------
4
5
6
我希望它显示为
Columns
--------
1
2
3
4
5
6
最佳答案
您可以使用unionAll
$first = DB::table('yourTable')
->select('column1 as res');
$result = DB::table('yourTable')
->select('column2 as res')
->unionAll($first)
->get();
关于laravel eloquent union,连接同一个表中的2列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50560837/