I just wanted to extract unique year value from this date type column. But I always get this error "You might need to add explicit type casts".
My desired output should be just "2020" value since I wanted a unique result. Please help. Thank you.
Here is my code:
$year= DB::table('loans')
->select('date_release', DB::raw('YEAR(date_release) as year'))
->groupBy('year')
->get();
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3efkY8p
via IFTTT

Aucun commentaire:
Enregistrer un commentaire