Getting Error in Query Builder in Table Widget

https://gist.github.com/abhi051002/cdbee5da66029f4ada377f3df40cceaa when i use a query in table widget it gives me the error " SQLSTATE[42803]: Grouping error: 7 ERROR: column "payments.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: ...ONTH FROM transaction_date) order by "month" asc, "payments"... ^" but when i use the same query any where and dd/info the result it works well why it is not working on query builder and give the erro and i know if i add the payments.id then it will work well but i want result without including it.
Gist
Getting the error "SQLSTATE[42803]: Grouping error: 7 ERROR: column...
Getting the error "SQLSTATE[42803]: Grouping error: 7 ERROR: column "payments.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: ...ONTH F...
10 Replies
Tieme
Tieme11mo ago
Please dont spam the system with multiple same questions.
hello_world
hello_worldOP11mo ago
i need the answer thats why i'm doing this
Patrick
Patrick11mo ago
config/database.php set your Strict to false, see if that helps
Patrick
Patrick11mo ago
@hello_world
No description
Patrick
Patrick11mo ago
if its on strict you must specify a select for everything that is in a groupby
hello_world
hello_worldOP11mo ago
no that didn't help
Patrick
Patrick11mo ago
mm could you add this to the query?
selectRaw('EXTRACT(MONTH FROM transaction_date) as month')
selectRaw('EXTRACT(MONTH FROM transaction_date) as month')
and strictly this has nothing to do with laravel filament
hello_world
hello_worldOP11mo ago
no this isn't working just want to mention that i'm using postgresql
Patrick
Patrick11mo ago
ooh sorry i have no experience with that type of database sorry
hello_world
hello_worldOP11mo ago
okay no worry thanks for the help
Want results from more Discord servers?
Add your server