MySQL Forums
Forum List  »  Newbie

Re: ANIDATED SELECT
Posted by: Peter Brawley
Date: October 23, 2017 10:34AM

select s.storename, x.more_than+3
from storeinfo s
join (
  select orders.store_id, count(*) as more_than_3 
  from order_info 
  join orders on orders.orders_id=orders_info.orders_id 
  where orders_info.num_items > 3 and orders.timeplaced > current timestamp - 1 day 
  group by orders.store_id
) x using(store_id);

Options: ReplyQuote


Subject
Written By
Posted
October 22, 2017 01:55PM
October 22, 2017 02:12PM
October 23, 2017 05:53AM
October 23, 2017 05:56AM
October 23, 2017 09:47AM
Re: ANIDATED SELECT
October 23, 2017 10:34AM
October 23, 2017 11:14AM
October 23, 2017 12:48PM
October 24, 2017 01:52AM
October 24, 2017 08:26AM


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.