skip to Main Content

Query in Laravel, get multiple data with GroupBy

I have a table with these columns: event_time (date) event_data (json) player_account char() I'm trying to get all three fields from my query and groupBy by "player_account" field. The problem is doing this query: DB::connection('aa')-table('bb') ->where('event_time', ">", $date) ->select('event_time', 'event_data',…

VIEW QUESTION

How to use multiple subqueries in Laravel's Eloquent?

I have a SQL query like this: SELECT year FROM ( SELECT my_custom_function_for_get_year(week_start::date) AS year FROM ( SELECT date_trunc('week', week_start) AS week_start FROM generate_series('2023-01-01'::date, '2023-12-31'::date, interval '1 week') gs(week_start) ) as select1, (SELECT id FROM mytable) as select2 ) as…

VIEW QUESTION
Back To Top
Search