• Oracle数据库的 增、删、改、查


    有时候数据库的查询语句一时想不起来,或不确定是不是语句写的正确,现在整理了一下标准的基本查询语句,便于以后牢记:

    、数据操作语言 DML:添加(insert into)、修改(update   set)、删除表中的数据。(delete)

     1.数据的添加:insert into 表名(字段名) values(对应的数据):

    --增加数据
    insert into student(sno,sname,ssex) values('102','张三','');
    --或者这样写
    insert into student values('102','张三','',sysdate,'95033');

    2.数据的修改:update 表名 set 修改的的字段 wiere 条件:

    --数据的修改
    update student set ssex='' where sno='102';
    --如果不加where,便是修改整个表某列的属性
    
    --对某一列数据的加减
    update student set sclass=sclass+1;
    update 表名 set 列名=列名+1 where 条件
    --日期的加减1为日的加减1

    3.数据的删除:

    delete 表名 where 条件;
    --数据的删除
    delete student where sno=102;
    --不加where,即删除整个表,但是效率低,可用truncate table 表名    来删除(先删表,再建表)
    例:truncate table student;

    4、数据查询语言 DQL:从表中获取数据(查询数据)。select * from 表名;

    --数据查询
    select * from student;--根据条件找字段
    select sno,sname from student where sclass='95031';
    select 字段名 from 表名 where 条件
  • 相关阅读:
    高性能反射初体验2
    高性能反射初体验1
    HTML解析原理
    QQ邮箱漂流瓶的"变化"~~
    javascript跟随滚动条滚动,onscroll事件的学习
    认识一下window.location.hash
    IE中替换a标签href属性的一个bug
    用css Sprites的时候IE6的一个小bug
    css中如何引入“非常” 字体
    [重温经典]ie6 不支持position:fix的解决方案
  • 原文地址:https://www.cnblogs.com/diaozhaojian/p/6209294.html
Copyright © 2020-2023  润新知