How to change the query with a number of records condition in all groups and with the sum for a specific column?
My script: -- DROP TABLE IF EXISTS test; CREATE TABLE IF NOT EXISTS test ( id smallserial, date_pr date, num smallint, naim text, pr numeric(19,4), txt text, CONSTRAINT test_pkey PRIMARY KEY (id) ) INSERT INTO test (date_pr, num, naim, pr, txt) VALUES ('2025-02-01', 1, 'naim_01', 11.4501, 'txt_11'), ('2025-02-01', 2, 'naim_02', 12.3302, 'txt_12'), ('2025-02-01', 3, 'naim_03', 14.5103, 'txt_13'), ('2025-04-03', 1, 'naim_01', 15.0101, 'txt_21'), ('2025-04-03', 2, 'naim_02', 16.0202, 'txt_22'), ('2025-04-03', 3, 'naim_03', 17.0303, 'txt_23'), ('2025-05-20', 1, 'naim_01', 18.0101, 'txt_31'), ('202
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.