I am trying to find the space occupied by list of tables in Oracle DB (for various SCHEMAS ) ,currently i am using this query QUERY 1 – DBA_SEGMENTS QUERY 2 – DBA_OBJECTS when i compare the LIST OF TABLES counts it’s not matching , what could be the reason ? can you please suggest is this correct or is
Tag: sum
Making cumulative sum with ids and dates in MySQL
Imagine I have this: id transactiondate transactiontag clientid transactionvalue 1 2020-12-28 pizza 0 29.99 2 2020-12-29 payment 0 -39.99 3 2020-12-28 cheese 0 -109.99 4 2020-12-28 cheese 0 -109.99 5 2020-12-28 pizza 1 -19.99 6 2020-12-28 cheese 1 -18.99 7 2020-12-28 salary 1 58.99 8 2020-12-29 salary 1 38.99 So I have all the Ids of transactions, when they were
Getting sum of two rows in an inner joined table
I have these two tables; trips id date revenue 1 01/01/2020 5000 2 01/01/2020 3000 3 02/01/2020 4000 4 02/01/2020 2000 expenses id tripid amount 1 1 500 2 1 300 3 2 400 4 2 200 5 2 700 I would like to get the sum of revenue collected in a day AND sum of expenses in a day.
sql get balance at end of year
I have a transactions table for a single year with the amount indicating the debit transaction if the value is negative or credit transaction values are positive. Now in a given month if the number of debit records is less than 3 or if the sum of debits for a month is less than 100 then I want to charge
Remove zero amount in a query
I have a table finalData with the following columns and data I am creating mysql query to display the income and expenses of Singapore per Area, but I have to exclude areas that has zero amount. Here’s the code I tried: Output should be like this Any help would be appreciated. Thanks Answer This logic would be simpler phrased with
How can I create summaries across columns?
I have an existing application database table supporting an application, and I’ve been tasked with adding another feature. Currently, we have a build table that stores information about product builds….
Group data by foreign key and date with total by date
I need help to select daily payments made and group by the organization and date. Group by date, then the total number of payments and the sum total amount of payments for each day Tables are as …
How to get the average from computed columns in Postgresql?
I have a query: SELECT sum(column_1), sum(…) as sum_1, sum(…) as sum_2, sum(…) as sum_3 FROM table_1 How to get an average data from sum_1, sum_2, sum_3? If I write a query in the next …
How to keep column name after sum aggregation in SQL query
I am querying SQL Server where I have multiple columns with sum aggregation. I’m wondering if there is a way to keep column name after doing sum over each of them. I want to avoid using aliases …
Postgres SUM over given time
I am trying to SUM google analytics data over a given time using Postgres. I am not quite sure how to get around a grouping issue. The query you see below returns one column per day. I want to SUM all …