常用oracle数据库查询命令
2017-12-04 09:05
381 查看
(1)Select * from tables(表名); //查询表tables的内容
(2)Truncate table tables(表名);//清除表内数据;但保留格式
(3)Select ID(列名)from tables groupby
ID(列名)、ID2(列名)havingcount(*)>1; //查询表中重复的数据
(4)Select * from tables(表名) a where a.id(列名)=’07552223’(重复的数据);//将在列ID中所有与07552223相同的数据排列出来
(5)delete from tables where rowid in (select min(rowid)fromtables where id=’15252525’) group by username); //删除table表中ID列数据为‘15252525’的重复项
(6)delete from table where rowid in(select min(rowid)fromtable group by id..id2); //删除表table中所有关于列(ID)的重复信息
(7)select * from tables where regex_like(id,’^[^[:digit:
]]+$’); //查询table在id列中所有是数字的数据
(8)select* from tables where regex_like(id,’^([a-z]|[A-Z]+[0-9]
+)$’);
//查询table在id列中所有带有字符和数字的数据
(9)select count(*)fromtables; //查询table中所有数据的行数
(10)select table_name from xxcj_tj_zdcj a group by a.table_
namecount(*) >1; //查询数据库xxcj_tj_zdcj中是否有重复的表
(11)select * from xxcj_tj_zdcj awhere a.table_name in (‘05255’) order by a.table_name for update; //修改数据库xxcj_tj_zdcj中的值(即括号内的内容)
(12)select * from xxcj_tj_zdcj awhere a.id=’’ for update;//修改数据库xxcj_tj_zdcj中id列的内容
(13)truncate table数据库; //数据比对
(14)select t.* ,t.rowid from 表名 t; //编辑表
(15)alter table 表名 add 列名 字符类型;//新建列
(16)alter table 表名 modify 列名 字符类型;//修改列类型
(17)alter table 表名 drop column 列名;//删除列(最后一列)
(18)select * from 表名 where asciistr(列名)not like ‘%\%’;//查询数据表中xx列中的为中文字符的数据
(19)select substr(f_get_sfzhm18(zjhm) ,7,8)as csrq from 表名where regexp_like(substr(f_get_sfzhm18(zjhm) ,7,1) ,’[^1[2]’);
(2)Truncate table tables(表名);//清除表内数据;但保留格式
(3)Select ID(列名)from tables groupby
ID(列名)、ID2(列名)havingcount(*)>1; //查询表中重复的数据
(4)Select * from tables(表名) a where a.id(列名)=’07552223’(重复的数据);//将在列ID中所有与07552223相同的数据排列出来
(5)delete from tables where rowid in (select min(rowid)fromtables where id=’15252525’) group by username); //删除table表中ID列数据为‘15252525’的重复项
(6)delete from table where rowid in(select min(rowid)fromtable group by id..id2); //删除表table中所有关于列(ID)的重复信息
(7)select * from tables where regex_like(id,’^[^[:digit:
]]+$’); //查询table在id列中所有是数字的数据
(8)select* from tables where regex_like(id,’^([a-z]|[A-Z]+[0-9]
+)$’);
//查询table在id列中所有带有字符和数字的数据
(9)select count(*)fromtables; //查询table中所有数据的行数
(10)select table_name from xxcj_tj_zdcj a group by a.table_
namecount(*) >1; //查询数据库xxcj_tj_zdcj中是否有重复的表
(11)select * from xxcj_tj_zdcj awhere a.table_name in (‘05255’) order by a.table_name for update; //修改数据库xxcj_tj_zdcj中的值(即括号内的内容)
(12)select * from xxcj_tj_zdcj awhere a.id=’’ for update;//修改数据库xxcj_tj_zdcj中id列的内容
(13)truncate table数据库; //数据比对
(14)select t.* ,t.rowid from 表名 t; //编辑表
(15)alter table 表名 add 列名 字符类型;//新建列
(16)alter table 表名 modify 列名 字符类型;//修改列类型
(17)alter table 表名 drop column 列名;//删除列(最后一列)
(18)select * from 表名 where asciistr(列名)not like ‘%\%’;//查询数据表中xx列中的为中文字符的数据
(19)select substr(f_get_sfzhm18(zjhm) ,7,8)as csrq from 表名where regexp_like(substr(f_get_sfzhm18(zjhm) ,7,1) ,’[^1[2]’);
相关文章推荐
- Oracle数据库用户查询常用命令
- 入侵oracle数据库时常用的操作命令整理
- GDB常用命令快速查询(英文版)
- Linux操作系统下常用命令集锦【一】查询进程对应信息Lsof命令详解
- cent os常用查询命令
- oracle运用(五) oracle数据库常用的99条查询语句
- oracle数据库时常用的操作命令
- 登录oracle数据库时常用的操作命令整理
- Oracle数据库的常用命令
- Oracle数据库基本常用命令
- MongoDB创建表步骤,Mongo常用的数据库操作命令,查询,添加,更新,删除_MongoDB 性能监测
- mysql的常用查询创建命令
- 常用 linux 查询日志排错命令 grep & less
- Git的初次使用 ; Git常用命令查询 ; Git push ; Git pull 2011-12-16 17:32 在介绍安装和简单使用前,先看一下百度百科中的简介吧: ———————————
- MySQL 常用的查询命令
- Oracle数据库执行脚本常用命令小结
- 登录oracle数据库时常用的操作命令整理
- matlab常用命令(查询备用)
- mysql字符串查询常用命令
- Mongodb常用命令之查询