日期:2014-05-18 浏览次数:20681 次
select jdyf from( select top 100 percent jdyf,CAST(jdyf + '-1' AS datetime) from jdjzjh order by 2 )t
------解决方案--------------------
create table jdjzjh(jdyf varchar(7))
insert into jdjzjh select '2011-6' union all select '2011-12'
go
SELECT DISTINCT convert(varchar(7),CAST(jdyf + '-1' AS datetime),120)
FROM jdjzjh
ORDER BY 1
/*
-------
2011-06
2011-12
(2 行受影响)
*/
go
drop table jdjzjh