当前位置:网站首页>Common modification commands of Oracle for tables
Common modification commands of Oracle for tables
2022-07-06 23:43:00 【Jaffy】
Sometimes when we do projects, we don't just touch a single database ,MySQL
Database or Oracle
database , Generally, you should learn more or less in the process of participation , Next, I will record a few of our Oracle
Several operation commands commonly used in database , In order to meet in the future , There is a place to find .
Add column fields of the table
alter table Table name add(
Field 1 data type ,
Field 2 data type
);
-- Example In the existing User Add an address field to the table `address`, The data type is varchar2, The length is 30
alter table user add(
address varchar2(30)
);
Modify the column fields of the table
alter table Table name modify( Field 1 data type ,.....)
-- Example , Modify existing User Address fields in the table `address`, The data type is varchar2, The length is 50
alter table user modify(address varchar2(50));
Remove the column fields of the table
alter table Table name drop column Field
-- Example , Delete existing tables User Address fields in the table `address`
alter table user drop column address
Set the comment for the field
COMMENT ON COLUMN " Table space "." Table name "." Field name " IS ' The comment ';
-- Example , Set the existing User Address fields in the table `address` The content of the note is ' Address '
COMMENT ON COLUMN "scott"."user"."address" IS ' Address ';
Paging templates
SELECT *
FROM (SELECT a.*, ROWNUM rn
FROM (
Business sql
) a
WHERE ROWNUM <= Final offset )
WHERE rn >= Starting offset
-- Example , Inquire about User The data table , Show the first page , each page 20 Data
SELECT *
FROM (SELECT a.*, ROWNUM rn
FROM (
select * from user
) a
WHERE ROWNUM <= 20)
WHERE rn >= 1
Create a sequence of tables
CREATE SEQUENCE " Table space "." The sequence of " MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE
-- Example , establish user Sequence of tables , Used to increment id
CREATE SEQUENCE "scott"."user_S" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE
边栏推荐
- The important data in the computer was accidentally deleted by mistake, which can be quickly retrieved by this method
- 使用MitmProxy离线缓存360度全景网页
- Summary of three methods for MySQL to view table structure
- 氢创未来 产业加速 | 2022氢能专精特新创业大赛报名通道开启!
- A novice asks a question. I am now deployed on a single machine. I submitted an SQL job and it runs normally. If I restart the service job, it will disappear and I will have to
- One minute to learn how to install the system, win7 XP, win10 and win11 become very simple
- Cloud native (32) | kubernetes introduction to platform storage system
- ArrayExpress数据库里的细胞只有两个txt是不是只能根据Line到ENA下载测序跑矩阵?
- 快手的新生意,还得靠辛巴吆喝?
- leetcode:236. 二叉树的最近公共祖先
猜你喜欢
求帮助xampp做sqlilab是一片黑
Pdf batch splitting, merging, bookmark extraction, bookmark writing gadget
Example code of MySQL split string as query condition
Zero code and high return. How to use 40 sets of templates to meet 95% of the reporting needs in the work
AI金榜题名时,MLPerf榜单的份量究竟有多重?
浅谈现在的弊端与未来的发展
《数字经济全景白皮书》保险数字化篇 重磅发布
After 3 years of testing bytecan software, I was ruthlessly dismissed in February, trying to wake up my brother who was paddling
Master binary tree in one article
亚朵三顾 IPO
随机推荐
How to implement Lua entry of API gateway
Docker mysql5.7 how to set case insensitive
请问oracle-cdc用JsonDebeziumDeserializationSchema反序列化
Realize colorful lines and shape your heart
Talking about the current malpractice and future development
(1)长安链学习笔记-启动长安链
Wu Enda 2022 machine learning course evaluation is coming!
Laravel8 uses passport authentication to log in and generate a token
Gradle知識概括
【系统分析师之路】第七章 复盘系统设计(面向服务开发方法)
CRMEB 商城系统如何助力营销?
flinksql select id ,count(*) from a group by id .
docker mysql5.7如何设置不区分大小写
Basic chart interpretation of "Oriental selection" hot out of circle data
吴恩达2022机器学习课程评测来了!
本地部署 zeppelin 0.10.1
MySQL connected vscode successfully, but this error is reported
How does crmeb mall system help marketing?
短链的设计
Oracle对表进行的常用修改命令