sql >> Base de Datos >  >> RDS >> Mysql

Laravel 4 - JOIN - Mismo nombre de columna

$query = DB::table('packages')
->join(...)
->join(...)
->select(DB::raw('packages.name as name1, assigned_packages.name as name2'))
->get();

editar:

$sql = "select a.name as name1, b.name as name2";
$sql .= " from a left join b on a.id=b.id1 and b.id2=&id";
$result = DB::select($sql);