--计算当前月的实际天数 Create FUNCTION dbo.CalcDaysOfMonth (@time varchar(6)) RETURNS int AS BEGIN DECLARE @Days int DECLARE @Month int DECLARE @Year int SET @Year=SUBSTRING(@time,1,4) SET @Month=SUBSTRING(@time,5,6) if( @Month='1' OR @Month='3' OR @Month='5'
代码如下:select a,b,c,count(*) from (select c.a,c.b,c.c from test c) having count(*) >= 2 group by a,b,c 或者 代码如下:select zdbh,tdzl,zdmj,count(*) from ecaadmin.zdsx group by zdbh,tdzl,zdmj having count(*) >= 2
您可能感兴趣的文章:用SQL