ANIDATED SELECT
Hi forum, I have a table with store info (idstore, storename) and another table with orders (idorder, idstore, etc..)
I need to know the number of orders for each store placed yesterday. The format of the output will be:
STORE_NAME NUM_ORDERS
Store1 5
Store2 10
The seudocode is the following:
X = SELECT STORE_ID, STORE_NAME FROM STORE
And for each X:
SELECT COUNT (*)
FROM ORDERS
WHERE TIMEPLACED > CURRENT TIMESTAMP-1DAY AND STORE_ID = X;
Can you help me please, I have tried to explain the best as possible.
Thanks beforehand.
Subject
Written By
Posted
ANIDATED SELECT
October 22, 2017 01:55PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.