SELECT
pname, SUM(ocount)
FROM
product,
orders
WHERE
product.pid = orders.pid
AND product.pname = '小米Note2'
AND orders.odate > '2016-11-30'
AND orders.odate < '2017-01-01';
SELECT
pname, SUM(ocount)
FROM
product,
orders
WHERE
product.pid = orders.pid
AND product.pname = '小米Note2'
AND orders.odate > '2016-11-30'
AND orders.odate < '2017-01-01';