当前位置:网站首页>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
边栏推荐
- What should I do if the USB flash disk data is formatted and how can I recover the formatted USB flash disk data?
- Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million
- Wasserstein Slim GAIN with Gradient Penalty(WSGAIN-GP)介绍及代码实现——基于生成对抗网络的缺失数据填补
- 人均瑞数系列,瑞数 4 代 JS 逆向分析
- 每日刷题记录 (十五)
- How can Oracle CDC deserialize with jsondebeziumdeserializationschema
- A few suggestions for making rust library more beautiful! Have you learned?
- Coscon'22 community convening order is coming! Open the world, invite all communities to embrace open source and open a new world~
- The important data in the computer was accidentally deleted by mistake, which can be quickly retrieved by this method
- 同一个作业有两个source,同一链接不同数据库账号,为何第二个链接查出来的数据库列表是第一个账号的
猜你喜欢
借助这个宝藏神器,我成为全栈了
求帮助xampp做sqlilab是一片黑
吴恩达2022机器学习课程评测来了!
js對JSON數組的增删改查
浅谈现在的弊端与未来的发展
英国都在试行4天工作制了,为什么BAT还对996上瘾?
Today, I met a senior test developer from Tencent and saw the ceiling of the foundation
If the request URL contains jsessionid, the solution
leetcode:236. The nearest common ancestor of binary tree
Gradle知识概括
随机推荐
Stop saying that microservices can solve all problems
PDF批量拆分、合并、书签提取、书签写入小工具
Eureka Client启动后就关闭 Unregistering application xxx with eureka with status DOWN
Wasserstein Slim GAIN with Gradient Penalty(WSGAIN-GP)介绍及代码实现——基于生成对抗网络的缺失数据填补
Experiment 4: installing packages from Gui
Coscon'22 community convening order is coming! Open the world, invite all communities to embrace open source and open a new world~
11 preparations for Web3 and Decentralization for traditional enterprises
零代码高回报,如何用40套模板,能满足工作中95%的报表需求
Today's sleep quality record 78 points
Gradle知識概括
自动更新Selenium驱动chromedriver
浅谈现在的弊端与未来的发展
Docker starts MySQL and -emysql_ ROOT_ Password = my secret PW problem solving
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
MySQL implementation of field segmentation from one line to multiple lines of example code
Gradle knowledge generalization
Knowledge * review
(1)长安链学习笔记-启动长安链
B站大佬用我的世界搞出卷積神經網絡,LeCun轉發!爆肝6個月,播放破百萬
Should the jar package of MySQL CDC be placed in different places in the Flink running mode?