zoukankan      html  css  js  c++  java
  • Oracle中的一些基本sql语句

    --新建表
    create table table1 (id varchar(300) primary key,name varchar(200) not null);
    --插入数据
    insert into table1 (id,name) values('aa','bb');
    insert into table1 (id,name) values('cc','dd');
    --更新数据
    update table1 set id='bb' where id='cc';
    --删除数据
    delete from table2 where id='bb';
    --删除表
    drop table table1;


    --修改表名
    alter table table1 rename to table2;
    --插入数据
    insert into table2 (id,name) values('bb','cc');

    --表数据复制
    insert into table1 (select * from table2);
    --复制表结构
    create table table1  as select * from table2 where 1>1;
    --复制表结构和数据
    create table  table3 as select * from table2;

    --复制指定字段
    create table table4 as  select id,name from table2 where 1>1;
    --条件查询
    select id,name, (case gender when 0 then '男' when 1 then '女' end) gender from table2;

  • 相关阅读:
    配置hbase
    hive配置
    scala及spark配置
    Eclipse 配置hadoop
    腾讯云部署hadoop
    助教总结
    预习非数值数据的编码方式
    预习原码补码
    学习java的第六周
    作业一总结
  • 原文地址:https://www.cnblogs.com/haoyuecanglang/p/7883124.html
Copyright © 2011-2022 走看看