当前位置:网站首页>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
边栏推荐
- Cover fake big empty talk in robot material sorting
- If the request URL contains jsessionid, the solution
- MySQL connected vscode successfully, but this error is reported
- A few suggestions for making rust library more beautiful! Have you learned?
- The important data in the computer was accidentally deleted by mistake, which can be quickly retrieved by this method
- Gpt-3 is a peer review online when it has been submitted for its own research
- 基础图表解读“东方甄选”爆火出圈数据
- Résumé des connaissances de gradle
- [212] what are three methods for PHP to send post requests
- Gradle知识概括
猜你喜欢
Up to 5million per person per year! Choose people instead of projects, focus on basic scientific research, and scientists dominate the "new cornerstone" funded by Tencent to start the application
【OFDM通信】基于深度学习的OFDM系统信号检测附matlab代码
Isomorphism + cross end, knowing applet +kbone+finclip is enough!
Basic chart interpretation of "Oriental selection" hot out of circle data
每日刷题记录 (十五)
The method of reinstalling win10 system is as simple as that
If the request URL contains jsessionid, the solution
电脑重装系统u盘文件被隐藏要怎么找出来
快讯 l Huobi Ventures与Genesis公链深入接洽中
Stop saying that microservices can solve all problems
随机推荐
Design of short chain
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
(1)长安链学习笔记-启动长安链
Two week selection of tdengine community issues | phase II
Gradle知識概括
Automatically update selenium driver chromedriver
《数字经济全景白皮书》保险数字化篇 重磅发布
快手的新生意,还得靠辛巴吆喝?
编译logisim
Win11怎么恢复传统右键菜单?Win11右键改回传统模式的方法
MySQL数据库之JDBC编程
The tutorial of computer reinstallation win10 system is simple and easy to understand. It can be reinstalled directly without U disk
The intranet penetrates the zerotier extranet (mobile phone, computer, etc.) to access intranet devices (raspberry pie, NAS, computer, etc.)
Leetcode problem solving - 889 Construct binary tree according to preorder and postorder traversal
传统企业要为 Web3 和去中心化做的 11 个准备
新手问个问题,我现在是单机部署的,提交了一个sql job运行正常,如果我重启了服务job就没了又得
Entropy information entropy cross entropy
Is the more additives in food, the less safe it is?
【无人机】多无人协同任务分配程序平台含Matlab代码
The best sister won the big factory offer of 8 test posts at one go, which made me very proud