Postingan lainnya
Error Query saat menggunakan Case When
$tbl = DB::table('leave_form')
->select('leave_form.status',
DB::raw('(CASE WHEN leave_form.status = Approved THEN 2 WHEN leave_form.status = Rejected THEN 1 ELSE 4) as orderingstatus'))
->get();
Screen Shot 2021-05-25 at 15.27.59.png
0
Tanggapan
gambarnya burem
1 Jawaban:
<pre> $tbl = DB::table('leave_form') ->select('leave_form.status', DB::raw('(CASE WHEN leave_form.status = "Approved" THEN 2 WHEN leave_form.status = "Rejected" THEN 1 ELSE 4) as orderingstatus')) ->get();</pre>
1