declare @t table(price decimal(10,2))
insert into @t select 1.00
union all select 1.01
union all select 1.02
union all select 1.03
union all select 1.04
union all select 1.05
union all select 1.06
union all select 1.07
union all select 1.08
union all select 1.09
union all select 1.18
union all select 1.16
union all select 1.56
select price,
case when Price%0.1 between 0.00 and 0.03 then round(Price,1,1)
when Price%0.1 between 0.04 and 0.07 then round(Price,1,1)+0.05
when Price%0.1 between 0.08 and 0.09 then round(Price,1,1)+0.1
end as 显示
from @T
是否在当天 restime 为实据库字段
select * from user_tb where datediff(dd,restime,getdate())=0
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
/*
**管理员登录
**传2个参数
**输出一个参数
*/
ALTER PROCEDURE [dbo].[admin_login]
(
@ad_name VARCHAR(20),
@ad_passwd VARCHAR(20),
@ad_level INT OUTPUT
)
AS
SET @ad_level = 0
SELECT @ad_level = ad_level
FROM jq_admin
WHERE ad_name = @ad_name AND CAST(ad_passwd AS VARBINARY(20)) = CAST(@ad_passwd AS
VARBINARY(20))
/*
**写事件
**传2个参数
**
*/
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[logg]
(
@logname varchar(20),
@logevet varchar(20)
)
AS
BEGIN
INSERT INTO jq_log (logname,logevet) values(@logname,@logevet)
END