序言 数据表的插入.更新.删除非常简单,但是简单的也要学习,细节决定成败. ---WH 一.插入数据 格式:INSERT INTO 表名(字段名...)VALUES(值...); 创建环境 使用person表 CREATE TABLE person ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, name CHAR(40) NOT NULL DEFAULT '', age INT NOT NULL DEFAULT 0, info CHAR(50) NULL,
创建数据表 Create table [if not exists] table_name(column_name data_type,…….) UNSIGNED 无符号SIGNED 有符号 查看创建的表 show tables; 查看mysql中所有的表 show tables from mysql; 查看表结构 show columns from tb1; (也可以用 DESC tb1;) 插入记录 Insert[into]table_name [(column,…)]values(va
create or replace trigger t before update on test5 for each rowbegin insert into test55 values (:old.id,:old.name);end ; -------------------------------------------------------------------------------------- --表中插入数据时ID自动增长 create table ttt (id numbe
declare @tablename varchar(200)declare @sql varchar(2000)declare cur_t cursor forselect name from sysobjects where xtype= 'U ' and status> =0 and name not in (select name from sysobjects where id in (select id from syscolumns where id in (select id f
一.查询zabbix数据库大小 mysql> select table_schema, concat(truncate(sum(data_length)/1024/1024,2),' mb') as data_size,concat(truncate(sum(index_length)/1024/1024,2),'mb') as index_size from information_schema.tables group by table_schema order by data_size d
公司有个需求,是用excel更新数据的,把错误的行列放到一个数组返回出来,正常的数据则插入,且返回数量 1.先需要引入phpspreadsheet,这里使用composer 安装 composer require phpoffice/phpspreadsheet 2.还需要在头部引入,命名空间自己根据vendor目录设置 use Exception; use PhpOffice\PhpSpreadsheet\Cell\Coordinate; use PhpOffice\PhpSpreadshee