mysql 5.0数据库使用
发布网友
发布时间:2022-04-19 16:50
我来回答
共3个回答
热心网友
时间:2022-05-01 04:12
mssql 的解释:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER TRIGGER [dbo].[sitedata_ins2]
ON [dbo].[SiteData] FOR INSERT -- 当[SiteData]表新增记录触发以下操作
AS
declare @recordtime as datetime
select @recordtime=recordtime from inserted -- ‘inserted’ 是指新增的记录信息(SiteData表),
if not exists(select recordtime from sitedata2Center1 where recordtime=@recordtime) --在sitedata2Center1表中查询是否存在相应的recordtime的记录
insert into sitedata2Center1 (recordtime) values(@recordtime) --如果没有相应记录就在sitedata2Center1表新增一条记录
--------------------------------------------
以下为你要的mysql的触发器的sql语句:
mysql> delimiter //
-> create trigger sitedata_ins2
-> before insert on SiteData
-> for each row
-> Begin
-> If not exists(select 1 from sitedata2Center1 where recordtime=new.recordtime) then
-> insert into sitedata2Center1(recordtime) values(new.recordtime);
-> END IF;
-> end;//
-> delimiter ;
Query OK, 0 rows affected (0.05 sec)
(祝你好运...)
热心网友
时间:2022-05-01 05:30
alter table pw_forums modify column descrip text ;
注意:如果更改字段的数据类型,则该列必须为空值(empty)
热心网友
时间:2022-05-01 07:04
alter table pw_forums modify column descrip text ;