原来的订单新增触发器
ALTER TRIGGER "tr_cust_order_in" on
dba.cust_order for insert
/* Watcom only
order 2
*/
/* Watcom only
for each row
*/
as
begin
update cust_order set
create_time = getdate(*)
where cust_order.trans_no = new_cust_order.trans_no
end
想增加时间判断
例:
time()=小于12:00 那么user_3=“早上”
time()=大于12:00 那么user_3='下午“
原来的订单新增触发器
[code=sql]ALTER TRIGGER "tr_cust_order_in" on
dba.cust_order for insert
/* Watcom only
order 2
*/
/* Watcom only
for each row
*/
as
begin
update cust_order set
create_time = getdate(*)
where cust_order.trans_no = new_cust_order.trans_no
在这里进行增加如何设置
time()=小于12:00 那么user_3=“早上”
time()=大于12:00 那么user_3='下午“
end
------解决方案--------------------
select case when DATEPART(hh,getdate())<12 then '上午' else '下午' end
------解决方案--------------------
LZ的系统不是SQL Server吧?
------解决方案--------------------
update cust_order set
create_time = getdate(*)
,case when time()=小于12:00 then user_3=“早上”
when time()=大于12:00 then user_3='下午“ end
where cust_order.trans_no = new_cust_order.trans_no
------解决方案--------------------
update cust_order set
create_time = getdate(*)
,user_3=case when time()=小于12:00 then “早上”
when time()=大于12:00 then '下午“ end
where cust_order.trans_no = new_cust_order.trans_no