__vasilich__
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
second one
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
KISS not even close)
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
yeah, you right
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
I agree
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
so to get first row I can use
LIMIT 1
, and for the last one ORDER BY period_start DESC LIMIT 1
, is there a simple way to get both?50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
THANKS!!! as far as I know
sql
was made for regular people to understand, but in my mind it hasn't clicked yet. Basic stuff are understandable though50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
at the moment I'm trying to figure out how to get last period, and both(first and last)
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
yeah, they're unique
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
I suspected it would require to do subqueries, but I hoped it would be simpler)
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
@Jochem ok, I finally got time to check you code(sorry about that), it does work, thanks!
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
WOW... I'll check it all later, bit busy at the moment, but on the first glance it's way beyond my knowledge)
50 replies
KPCKevin Powell - Community
•Created by __vasilich__ on 7/20/2023 in #back-end
Select ranges with max simultaneous processes (SQLite)
cid
- process id, I think it's not needed, count
should be calculated - the count of processes running in the range.
so on 1 row we have 1 process running, on 2 - 2, on 3 - 3, on 4 - 2 because one is ended, so on 3 row was the start of the range and on 4 row is the end, and count is 3. that's how we get
50 replies