zoukankan      html  css  js  c++  java
  • 《mysql必知必会》学习_第19章

    第19章 插入数据

    P132

    insert into customers VALUES(NULL,'Pep E.Lapew','100 Main Street',,Los Angeles','CA','90046','USA',NULL,NULL); #customers表中刚好有9个维度(一定要对应上),9个值会对应这9个维度,维度的次序由表定义#

    insert into customers (cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email) VALUES(NULL,'Pep E.Lapew','100 Main Street',,Los Angeles','CA','90046','USA',NULL,NULL); #把维度列出来,按这个顺序对应后面的值填充到新行#

    跑出来对应的结果是这样:

    insert into customers(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country) VALUES('Pep E.Lapew','100 Main Street',‘Los Angeles','CA','90046','USA') 

    insert into customers(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country) VALUES('Pep E.Lapew1','100 Main Street1',’Los Angeles1','CA1','90045','USA1');  #同时增加两行,维度和值一一对应#  #是的我没运行出来,不知道是不是版本的问题,还是语句出错了)

    insert into customers(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country) VALUES('Pep E.Lapew','100 Main Street',‘Los Angeles','CA','90046','USA') 

    ,('Pep E.Lapewo','100 Main Streeto',’Los Angeleso','CAo','90045','USA');     #和上面表达的意思是一样#

     

     

    insert into customers(cust_id,cust_contact,cust_emails,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country)

    select  cust_id,cust_contact,cust_emails,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country from custnew;

    #在custnew里面对应的这些列的数据导入到表customers中,注意这个语句没有了values(‘ ’) #

  • 相关阅读:
    .NET自动化测试手记(2) 实例:点击计算器按钮
    解决httpwebrequest无法通过使用代理的局域网获取response的问题
    iOS开发之SQLite
    iOS开发之AVAudioPlayer 音频播放
    iOS开发 键盘添加工具条(toolbar)
    UIPickerView中的实例方法
    TextField
    UISearchBar和UISearchDisplayController
    Objectivec 字符串遍历的几种方法
    《Write ObjectiveC Code》学习笔记
  • 原文地址:https://www.cnblogs.com/qiyuanjiejie/p/9450564.html
Copyright © 2011-2022 走看看