zoukankan      html  css  js  c++  java
  • Mysql笔记1

    1.Insert

    INSERT INTO `mes`.`prc_operation_history`
    (`factory_name`,
    `name`,
    `timekey`,
    `create_time`,
    `create_user`,
    `last_event_time`,
    `last_event_user`,
    `type`)
    VALUES
    ('Module',
    '73000',
    '2017/10/19/12/35',
    '2017/10/19/12/35',
    'admin',
    '2017/10/19/12/35',
    'admin',
    'R');
    View Code
     

     2.UpDate

    update job_lot_history set last_event_name='trackin' where true=true;

    update rtm_machine_history set machine_state_name='idel' where timekey='2017/10/20/13/12';

     3.Select

    select * from job_lot_history;
    

     4.Create

    create temporary table `job_product_history_temp` like `job_product_history`;
    

     5.Truncate

    truncate job_product_history_temp;
    

     6.Drop

    drop table job_product_history_temp;
    

     7.复制表以及表中内容

    create temporary table `job_lot_history_temp` like `job_lot_history`;
    insert into job_lot_history_temp (select * from job_lot_history);
    update job_lot_history_temp set last_event_name = 'trackout' where true = true;
    update job_lot_history_temp set timekey = date_add(timekey,interval  12 hour) where true = true;
    insert into job_lot_history (select * from job_lot_history_temp);
    select * from job_lot_history_temp
    
    但愿人长久 千里共婵娟
  • 相关阅读:
    NPM
    Angular2.0快速开始
    AngularJS常用插件与指令收集
    Linq 操作基础
    SQL Server2008 with(lock)用法
    SQL Server2008 MERGE指令用法
    SQL Server2008 表旋转(pivot)技术
    ef to sqlite 实际开发问题终极解决方法
    windows控件常用缩写
    SQL 查询总结
  • 原文地址:https://www.cnblogs.com/hellcats/p/7711975.html
Copyright © 2011-2022 走看看