当前位置:网站首页>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
边栏推荐
- AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务...
- Newsletter L Huobi ventures is in-depth contact with genesis public chain
- 《数字经济全景白皮书》保险数字化篇 重磅发布
- Should the jar package of MySQL CDC be placed in different places in the Flink running mode?
- Restoration analysis of protobuf protocol of bullet screen in station B
- What should I do if the USB flash disk data is formatted and how can I recover the formatted USB flash disk data?
- The method of reinstalling win10 system is as simple as that
- Can online reload system software be used safely? Test use experience to share with you
- docker启动mysql及-eMYSQL_ROOT_PASSWORD=my-secret-pw问题解决
- Can async i/o be implemented by UDF operator and then called by SQL API? At present, it seems that only datastre can be seen
猜你喜欢

Experiment 4: installing packages from Gui

Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million

Ajout, suppression et modification d'un tableau json par JS

Résumé des connaissances de gradle
docker启动mysql及-eMYSQL_ROOT_PASSWORD=my-secret-pw问题解决

Can online reload system software be used safely? Test use experience to share with you

Stop saying that microservices can solve all problems

使用MitmProxy离线缓存360度全景网页

机器人材料整理中的套-假-大-空话

Today's sleep quality record 78 points
随机推荐
每人每年最高500万经费!选人不选项目,专注基础科研,科学家主导腾讯出资的「新基石」启动申报...
同一个作业有两个source,同一链接不同数据库账号,为何第二个链接查出来的数据库列表是第一个账号的
STM32通过串口进入和唤醒停止模式
若依请求url中带有jsessionid的解决办法
食品里的添加剂品种越多,越不安全吗?
Yaduo Sangu IPO
The same job has two sources, and the same link has different database accounts. Why is the database list found in the second link the first account
快讯 l Huobi Ventures与Genesis公链深入接洽中
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
Gpt-3 is a peer review online when it has been submitted for its own research
电脑重装系统u盘文件被隐藏要怎么找出来
How can Oracle CDC deserialize with jsondebeziumdeserializationschema
【OFDM通信】基于深度学习的OFDM系统信号检测附matlab代码
机器人材料整理中的套-假-大-空话
这个『根据 op 值判断操作类型来自己组装 sql』是指在哪里实现?是指单纯用 Flink Tabl
基础图表解读“东方甄选”爆火出圈数据
吴恩达2022机器学习课程评测来了!
使用MitmProxy离线缓存360度全景网页
Server SMP, NUMA, MPP system learning notes.
公链与私链在数据隐私和吞吐量上的竞争