我的sql 语句in,为什么用不了啊?
select `products`.product_model, sum( quantity ) as sum_total, `product_descriptions`.product_name
from order_products, product_descriptions, products
where `order_products`.product_id = `products`.product_id
and `product_descriptions`.product_id = `products`.product_id
and `products`.order_id
in (
select `orders`.order_id
from `orders`
where date_created
between '2009-01-01'
and '2012-01-01'
)
group by `products`.product_id
limit 0 , 30
然后提示#1054 - unknown column 'products.order_id' in 'in/all/any subquery'
给点指点!!!
------解决方案--------------------
products表中有order_id这个字段吗?