Skip to content

Tag: oracle

How do I count and sum from different tables (SQL)

I am trying to write an SQL statement that does this: For each customer that has an order, I need to list the customer’s number, the number of orders that customer has, the total quantity of items on those orders and the total price for those items. I then to need sort the result by the customer number.…

How update row with inner joins

I have this select statement where I found two rows, and I want to update a specific column: I have tried: How do I correctly construct the update query? SOLUTION: Answer Just put your query as a table: Here is a demo: DEMO

Invalid Number ORA-01722

I have problem in my query that I always get this kind of error ORA-01722: invalid number Whatever I try to doesn’t work. The query is here SELECT * FROM ( SELECT p….

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 &#8…