• 数据库操纵语言(DML)


    Insert 插入语句:

    insert into 表名(字段名1,字段名2,字段名3,…)values(”字段值1”,”字段值2”,”字段值3”…)

    例:insert into student(userID,name,sex,…)values(“001”,”张三”,”男”…);

    Insert …select语句:

    insert into 表名(字段名1,字段名2,字段名3,…)select 语句

    例:insert into student(userID,name) select ID,name from user where ID=”002” # 将user表中的用户id和用户名插入到student表中。

    Update语句:

    Update 表名 set列名=”更新值” where 条件

    例:update student set name=”Tom” where name =”Tiny”  # 将student表中Tom的姓名改为Tiny。

    注:修改多个列的值时可以在字段中加英文逗号,

    例:update student set name =”Tom”,sex=”男”;  # 不加where就是表示修改所有的姓名和性别。

    Delete语句:

    Delete from 表名 where 条件

    例:delete from student where name=”Tom”; #从student表中删除名字为Tom的数据。 

  • 相关阅读:
    报表打印
    MyGridControl
    用户控件制作时设计模式加载报错的解决办法
    代码生成工具
    上传控件的使用
    数据加密
    DevExpress介绍
    记一次手动安装pecl扩展memcache
    关于httpd.conf的一点随笔
    temp
  • 原文地址:https://www.cnblogs.com/yhcTACK/p/14965423.html
Copyright © 2020-2023  润新知