• 联合约束 CONCAT()


    w SELECT 原理。

    1 SELECT * FROM wz WHERE CONCAT(wint,wchar) NOT IN (SELECT CONCAT(wint,wchar) FROM wa);
    2 SELECT * FROM wz WHERE CONCAT(wint,wchar)     IN (SELECT CONCAT(wint,wchar) FROM wa);
     1 TRUNCATE wz;
     2 INSERT INTO wz SELECT * FROM wa WHERE id>14;
     3 INSERT INTO wz SELECT * FROM wb WHERE id<9;
     4 INSERT INTO wz SELECT * FROM we WHERE id>10 AND id<15;
     5 UPDATE wz SET wchar=CONCAT(wint,'wz');
     6 INSERT INTO wz(wint,wchar) SELECT wint,wchar FROM wa WHERE id>14;
     7 INSERT INTO wz(wint,wchar) SELECT wint,wchar FROM wb WHERE id<9;
     8 INSERT INTO wz(wint,wchar) SELECT wint,wchar FROM we WHERE id>10 AND id<15;
     9 
    10 
    11 
    12 
    13 UPDATE wa SET wint=id+100;
    14 UPDATE wa SET wint=id+4444,wchar=CONCAT(wint,'wa');
    15 DELETE FROM wa WHERE id>16;
    16 
    17 UPDATE wb SET wint=id+1000;
    18 UPDATE wb SET wchar=CONCAT(wint,'wb');
    19 DELETE FROM wb WHERE id>16;
    20 
    21 UPDATE we SET wint=id+10000;
    22 UPDATE we SET wchar=CONCAT(wint,'we');
    23 DELETE FROM we WHERE id>16;

    wz

    id wint wchar

    15 115 115wz
    16 116 116wz
    1 1001 1001wz
    2 1002 1002wz
    3 1003 1003wz
    4 1004 1004wz
    5 1005 1005wz
    6 1006 1006wz
    7 1007 1007wz
    8 1008 1008wz
    11 10011 10011wz
    12 10012 10012wz
    13 10013 10013wz
    14 10014 10014wz
    17 115 115wa
    18 116 116wa
    19 1001 1001wb
    20 1002 1002wb
    21 1003 1003wb
    22 1004 1004wb
    23 1005 1005wb
    24 1006 1006wb
    25 1007 1007wb
    26 1008 1008wb
    27 10011 10011we
    28 10012 10012we
    29 10013 10013we
    30 10014 10014we

  • 相关阅读:
    python文件上传
    Django
    Python生产环境部署(fastcgi,uwsgi)
    tp3.2 自带的文件上传及生成缩略图功能
    图片上传--base64
    图片上传
    PHP处理大数据量老用户头像更新的操作--解决数据量大超时的问题
    mysql悲观锁处理赠品库存超卖的情况
    bzoj 3551: [ONTAK2010]Peaks加强版
    bzoj 4817: [Sdoi2017]树点涂色
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6336620.html
Copyright © 2020-2023  润新知