how do you do percentages in a query with lots of sub groups? I have a table with firebird. I have tried SQL but it uses OVER and PARTITION, but they don’t seem to be working on my computer. The Over and Partition come out green, does that mean something? When I run the query, they do not seem to do anything.
The percentage sqL I want to try is
SELECT
“Rando stuff”,
“how much”,
“Play time”,
SUM (“how much”) OVER (PARTITION BY “Rando stuff”) as ThingsTotal,
“how much”/SUM(“how much”) OVER (PARTITION BY “Rando stuff”) as “Percentage”
FROM “PercentageMe”
Would this code work? Would my percentage dreams come true? Would the tempation of a simple calc sheet be gone for good? Have I made some type of error. Is there some other alternative I can use in base? I can not even get this running total to work.
SELECT “Id”, “name”, “gender”, “salary”,
sum(“salary”) over (Partition by “gender”) as “RunningTotal”
FROM “RunMe”
Is there something more I need to do? When I do edit Run, things happen. When I press the run SQL command directly, nothing happens. Is there a mystery box to tick somewhere in the settings.
Thanks.