mysql 字段选择

点击量:44

ip 地址用int

create table filedtest(
    id int auto_increment not null primary key ,
    ip int unsigned not null  -- 一定使用无符号,因为会超出
);

insert into filedtest(ip) values(inet_aton('255.255.255.255')),(inet_aton('192.168.1.1'));

select id,inet_ntoa(ip) from filedtest; -- 查询使用函数

使用enum代替固定的字符串

ALTER TABLE reporttask MODIFY reporttype ENUM('库存调拨明细', '库存调拨汇总', '库存成本明细', '库存成本汇总') NOT NULL COMMENT '报表类型';

select reporttype+0,reporttype from reporttask; --第一列显示的数字

mysql 字段选择》有1个想法

  1. Write more, thats all I have to say. Literally, it seems as though you relied on the video to
    make your point. You clearly know what youre talking about, why throw away your
    intelligence on just posting videos to your
    weblog when you could be giving us something informative to
    read?

发表评论

电子邮件地址不会被公开。

19 − 13 =