oracle简单使用

oracle中只能使用values插入数据,想要批量插入,就要拼接

oracle中相对字符串数据排序,可以使用to_number(字段名)

1
2
select *  from (
select *  from test t where t.is_use='Y' ) where rownum<10

  

oracle的for update 会造成锁表操作

oracle创建表,对字段设置默认值

1
2
3
4
5
create table test(
    id_test varchar2(32) not null,
   is_use varchar2(2) default 'Y' not null
 
)initrans 6;

 创建表的同义词

1
create public synonym test for test

  删除同义词

1
drop public synonym test

  查询oracle数据库中表的记录数(限制返回10行)

1
2
select *  from (
select *  from test  t where t.is_use='Y' ) where rownum<10

 按照时间查询

1
select *  from test t where t.d_time>=to_date('2022-07-06 00:00:00','yyyy-mm-dd hh24:mi:ss')

  删除表中字段

1
2
3
4
5
6
alter table 表名 drop column 字段名(即列名);
 
test  表名
name  字段名
 
alter table test drop column name;

  

删除表中索引,通过pl/sql工具查看表中索引的名称

1
drop index 索引名称

  

posted @   不忘初心2021  阅读(143)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
历史上的今天:
2021-07-05 搭建springcloud单机环境下的注册中心,服务提供者,服务消费者
点击右上角即可分享
微信分享提示