当我将日期范围放在同一年时,一切正常。例如,使用12-01-2015到12-31-2015这一切都很好。但是当我尝试使用12-01-2015到01-30-2016时,它返回0结果。我在这做错了什么?
SELECT "Glass Separating From Frame", count('x') from returns
INNER JOIN orders
ON orders.orderid = returns.orderid
WHERE returns.productcode in (189000, 182003) AND
from_unixtime(orders.init_date, "%m-%d-%Y") between "MM-DD-YYYY" and "MM-DD-YYYY"
and returns.returnid NOT IN (56116, 57823)
and returns.internal_notes LIKE "%Glass Separating From Frame%"
的MySQL。