Skip to content

SQL – How can I rewrite this request without many SELECT

I want to have the number of open requests for each month before the 1st of each month. I use ComboChart and my orange line is, at the moment, the average for the 6 past months, I want to change this data for the opened requests. Exemple : for April, I have 2 new requests and 1 closed request and

Populating Bridge tables

Hello I have a bridge table that has these two columns only to carry the IDs from other dim tables I’m wondering how can I populate this bridge table and make it related because a simple insert into a …

PostgreSQL group by column with aggregate

I need to group by id and select the task with min/max seq as start and end But this results in But I do not want group by seq Answer One method uses arrays: Another method uses window functions with SELECT DISTINCT: