Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

KharNam's avatar

Date format in Sql

I read the query like this, what does it mean? thanks

DB::raw("DATE_FORMAT(created_at, '%Y/%m') history_date")
0 likes
4 replies
KharNam's avatar

Thanks, If it reformats the data, what does history_date in the back mean?

jlrdw's avatar

Looks like an alias was used.

1 like
KharNam's avatar

like

DB::raw("DATE_FORMAT(created_at, '%Y/%m') as `history_date`")

i think so

Please or to participate in this conversation.