skip to Main Content

Min dates from group by postgresql

I have table with data: create table measure_app_scalemeasurement ( store_code text, certificate_id text, audit_ending date); insert into measure_app_scalemeasurement values ('K010','vwv', '10.12.2023'), ('K010','cert1','12.12.2023'), ('K054','vwv', '14.12.2023'), ('K054','cert1','20.01.2024'); I want to select min audit_ending date for each market store_code, also getting its corresponding…

VIEW QUESTION

MySQL Joining same table multiple times makes count go weird

Edited to clarify and simplify I have the following query select Signups.user_id, Count(timeoutTable.user_id) as timeoutCount, Count(confirmedTable.user_id) as confirmedCount from Signups left join ( select * from Confirmations where action = 'timeout' ) as timeoutTable on signups.user_id = timeoutTable.user_id left join…

VIEW QUESTION
Back To Top
Search