SQL代码问题 求解

select
convert(varchar(20),year(min(Vn_Date)))+'-'+
convert(varchar(20),month(min(Vn_Date)))
from Vendition#Note where Vn_CiClientID=1 and Vn_BiBrandID=1

 

select
min(convert(varchar(20),year(Vn_Date))+'-'+
convert(varchar(20),month(Vn_Date)))
from Vendition#Note where Vn_CiClientID=1 and Vn_BiBrandID=1

 

 

如果再插入一条09年12月份的信息,算出的结果是一样的,都是2009-12,不知道是为什么

 

自己感觉两段代码差不多,结果确不一样,希望大家能帮忙看看

posted on 2011-02-12 15:02  VictorShan  阅读(135)  评论(0编辑  收藏  举报

导航