找回密码
 立即注册
CeraNetworksBGVM服务器主机交流会员请立即修改密码Sharktech防护
查看: 186|回复: 1

大神,来看看

[复制链接]

6

主题

13

回帖

78

积分

注册会员

积分
78
发表于 2017-6-20 09:04:05 | 显示全部楼层 |阅读模式
大神们,帮帮忙,为啥这里执行错误
CREATE TABLE film(
    id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    infohash CHAR(40) UNIQUE,
    name VARCHAR(300) DEFAULT "",
    length BIGINT UNSIGNED DEFAULT 0,
    ctime INT UNSIGNED DEFAULT 0,
    click INT UNSIGNED DEFAULT 0,
    lastac INT UNSIGNED NOT NULL,
    ymd DATE NOT NULL
)ENGINE=MyISAM CHARACTER SET "utf8";

CREATE TABLE IF NOT EXISTS file(
    id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    fmid INT UNSIGNED NOT NULL,
    file VARCHAR(300) NOT NULL DEFAULT "",
    length BIGINT UNSIGNED DEFAULT 0
)ENGINE=MyISAM CHARACTER SET "utf8";
CREATE INDEX fmid_i ON file(fmid);

CREATE TABLE IF NOT EXISTS sph_counter(
    counter_id INT PRIMARY KEY NOT NULL,
    max_doc_id INT NOT NULL
)ENGINE=MyISAM CHARACTER SET "utf8";

CREATE TABLE IF NOT EXISTS counter(
    ymd DATE PRIMARY KEY,
    today INT UNSIGNED
)ENGINE=MyISAM CHARACTER SET "utf8";

DELIMITER |
CREATE TRIGGER after_film_insert AFTER INSERT ON film
FOR EACH ROW BEGIN
    INSERT INTO counter(ymd, today) VALUES(new.ymd, 1)
    ON DUPLICATE KEY UPDATE today=today+1;
END
|
DELIMITER ;
回复

使用道具 举报

28

主题

115

回帖

488

积分

中级会员

积分
488
发表于 2017-6-24 14:57:41 | 显示全部楼层
没有问题,有问题的话是和别的语句结合才会有!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|HS2V主机综合交流论坛

GMT+8, 2024-11-16 22:01 , Processed in 0.046328 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表