select * from invoicedetail t2 where t2.Memo is null and to_char(to_date(t2.PrintDate,'yyyy-MM-dd hh24:mi:ss'), 'yyyy-MM-dd') BETWEEN to_date('2016-09-01','yyyy-mm-dd') AND to_date('2016-09-29','yyyy-mm-dd' )
oracle 数据库存储过程 时间参数值 要以字符串类型传值 不能以日期传值 以防时间类型自动被截断为短日期格式
PROCEDURE GET_ENDTIME ( VRETURN_LIST OUT OUTPUTLIST, VUPLOADTIME IN VARCHAR2 --时间字段参数值要以字符串类型最佳 )
mysql 记录删除的动作
DELIMITER $$ USE `Test`$$ DROP TRIGGER /*!50032 IF EXISTS */ `SYS_OPM_trigger`$$ CREATE /*!50017 DEFINER = 'root'@'%' */ TRIGGER `SYS_OPM_trigger` AFTER DELETE ON `OPM_Alarm` FOR EACH ROW BEGIN DECLARE str VARCHAR(40000); SET str=CONCAT(old.AlarmId,'@',old.AlarmCode,'@',old.AlarmTypeId,'@',old.AlarmLevelId,'@', old.AlarmObjectCode,'@',old.AlarmStatus,'@',old.AlarmHandleUser,'@',old.AlarmHandleTime,'@', old.AddTime,'@',old.ParkUserId,'@',old.BerthCode,'@',old.BargainOrderCode,'@',old.BerthStartTime); INSERT INTO OPM_AlarmAction_log(UserName,Client_IP,Delete_before_key,Delete_Date) VALUES(SUBSTRING_INDEX(USER(),'@',1),SUBSTRING_INDEX(USER(),'@',-1), str, NOW()); END; $$ DELIMITER ;