Skip to content
Advertisement

Tag: window-functions

selecting max value from table with two variable colums (microsoft SQL)

i´m working with a table that looks like this: Start https://i.stack.imgur.com/uibc3.png My desired result would look like this: Result https://i.stack.imgur.com/v0sic.png So i´m triyng to select the max value from two “combined” colums. If the values are the same amount (Part C), the outcome doesn’t matter. I tried to order the table by max value and then using distinct but the

SQL Query calculating two additional columns

I have a table which gets populated daily with database size. I need to modify the query where I can calculate daily growth and weekly growth. Current Output I would like to add two additional columns which would be Daily Growth (DB_SIZE sysdate – DB_SIZE (sysdate -1)) Weekly Growth (DB_SIZE sysdate – DB_SIZE (sysdate -7)) Need some help constructing the

Advertisement