skip to Main Content

Select ordered rows up to certain id – Postgresql

INSERT INTO "public"."catalog_element" ("id", "catalogue_id", "element_id", "weight") VALUES (1,100,1,0), (2,100,2,1), (3,100,3,2), (4,10,1,0), (5,10,5,0), (6,10,6,1), (7,100,7,1); Let say, we have a Postgres table of catalog *- to -* element matching rows that are weighted, like such id catalogue_id element_id weight 1…

VIEW QUESTION

Iterate through data and calculate the sum of the last three days of each month – Postgresql

DB-Fiddle CREATE TABLE sales ( id SERIAL PRIMARY KEY, event_date DATE, sales_volume INT ); INSERT INTO sales (event_date, sales_volume) VALUES ('2023-01-27', '900'), ('2023-02-28', '500'), ('2023-01-29', '100'), ('2023-01-30', '600'), ('2023-01-31', '450'), ('2023-02-25', '300'), ('2023-02-26', '250'), ('2023-02-27', '845'), ('2023-02-28', '520'), ('2023-03-26', '750'),…

VIEW QUESTION
Back To Top
Search