-- ============================================= -- 功能:汉字转换成拼音首字母 首字母查 -- ============================================= )='') ) as begin --定义变量 ), @ii int ),) --设置初始值 --开始循环取出没个字符 while @ii<@strlen begin ,,) if @chn>'z' ,@c = case chn when @chn then
SQL 语句日期用法及函数 --DAY().MONTH().YEAR()——返回指定日期的天数.月数.年数: select day(cl_s_time) as '日' from class --返回天 select '月'=month(cl_s_time) from class --返回月 select '年'=year(cl_s_time) from class --返回年 --DATEADD(datepart,number,date)——在日期上增加给定日期类型的数量: select
--步骤:创建日期表,放初始放初始化资料 --因为农历的日,是由天文学家推算出来,到现在只有到年,以后的有了还可以加入! if object_id('SolarData') is not nulldrop table SolarDatagocreate table SolarData ( yearid int not null, data char(7) not null, dataint int not null ) --插入数据 insert into SolarData select