select distinct Convert(varchar(10),orderdate,120) as "672"
from d_orderdetail inner join D_Order on D_Order.orderid=d_orderdetail.orderid
where (productid=672)
and (Convert(varchar(10),orderdate,120) between '2004-07-01' and '2005-06-30')
order by orderdate
这样就可以了
select distinct to_char(orderdate,'yyyy-mm-dd') as "672"
Select CONVERT(varchar(30),getdate(),102) 这个可以转换
STR_TO_DATE((DATE_FORMAT(time,'%Y-%m-%d')),'%Y-%m-%d')
select distinct DATE_FORMAT(orderdate ,'%Y-%m-%d') as "672"
from d_orderdetail inner join D_Order on D_Order.orderid=d_orderdetail.orderid
where (productid=672)
and (DATE_FORMAT(orderdate ,'%Y-%m-%d') between '2004-07-01' and '2005-06-30')
order by orderdate