Skip to content
Advertisement

DB:Raw not working for date format in postgres

I have the well executed postgres query.I have tried to convert this in laravel

but query not executed

JavaScript

try 1

JavaScript

But no luck.getting Parse error: syntax error, unexpected ‘}’, expecting ‘;’

Try 2

JavaScript

Nothing return from my try 2

Advertisement

Answer

I don’t know if the SQL itself is alright since I’m not that experienced with postgres, but your query could be written like this in the Query Builder. You can verify it outputs the exact same query by dumping the $sql variable.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement