测试模型

最近更新时间:2021-01-06 17:44:59

1、库表结构

CREATE TABLE `sbtest` (
              `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
               `k` int(10) unsigned NOT NULL DEFAULT '0',
               `c` char(120) NOT NULL DEFAULT '',
                `pad` char(60) NOT NULL DEFAULT '',
                PRIMARY KEY (`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8

2、数据格式

 id:    1
 k:     97495
 c:     20391144908-12233345219-78132302102-50416212290-20312344529-12581235131-23512196132-31231681290-92121313621-82214276312
pad:  31213358112-12341921325-21141650120-19991415779-23043834987

3、SQL查询样式

1、查询

SELECT c FROM sbtest14 WHERE id=216
SELECT c FROM sbtest13 WHERE id BETWEEN 2235 AND 2235+99
SELECT SUM(K) FROM sbtest5 WHERE id BETWEEN 2235AND 2235+99
SELECT DISTINCT c FROM sbtest12 WHERE id BETWEEN 2235AND 2235+99 ORDER  BY c

2、写入

INSERT INTO sbtest11 (id, k, c, pad) VALUES (74042, 921531,'20391144908-12233345219-78132302102-50416212290-20312344529-12581235131-2351    2196132-31231681290-92121313621-82214276312', ' 31213358112-12341921325-21141650120-19991415779-23043834987')`

3、更新

UPDATE sbtest5 SET k=k+1 WHERE id=398
UPDATE sbtest11 SET c='20391144908-12233345219-78132302102-50416212290-23012344529-12581235131-23
512196132-31023168290-92121313621-82214276312'  WHERE id=9998

4、删除

DELETE FROM sbtest15 WHERE id=5

金山云,开启您的云计算之旅

免费注册