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();
via Chebli Mohamed

Aucun commentaire:
Enregistrer un commentaire