It's my controller :
public function lihatpesanansemua() //ajax
{
if(Request::ajax())
{
$hasil = DB::table('pesanan')->join('pemesan','pemesan.id', '=', 'pesanan.idpemesan')->join('komputer', 'komputer.id' ,'=', 'pesanan.idkomputer')
->select('pesanan.id', 'pemesan.nama', 'pesanan.tglpesan', 'pesanan.jampesan', 'pesanan.jamakhir', 'komputer.nama_komputer', 'komputer.lantai', 'komputer.Kelas')
->orderby('pesanan.id', 'asc')
->get();
$hasil = json_encode($hasil);
return $hasil;
}
}
And that's is inner join. How to change to full outer join ? Thanks, sorry my bad english
I don't know what exactly your query is trying to achieve, and where you need a full outer join, but I will begin this answer by saying that MySQL has no inbuilt support for full outer join. Based on this SO question, we can find a way an alternative way to write the following query:
This can be rewritten as a
UNION
of a left join and a right join:In Laravel, we can write the following code to represent the above full outer join:
Again, I don't know why you think you need two outer joins, but regardless you should be able to adapt the above code and query and use it for your situation.
References: