i have 2 tables: orders , orderproducts. both have column called 'order_id'.
orders has column named 'date_created' ordersproducts has column named 'sku'
i want select skus in within date range.
my query far is:
select `sku` `orderproducts` inner join orders on orderproducts.order_id = orders.order_id orders.order_id in (select id orders date_created between '2014-10-01' , '2015-03-31' order date_created desc)
the query runs returns nothings. missing here?
try putting date
condition in where
clause, there no need subquery:
select op.`sku` `orderproducts` op join `orders` o using(`order_id`) o.`date_created` between '2014-10-01' , '2015-03-31'