当前位置:网站首页>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
边栏推荐
- MySQL数据库之JDBC编程
- The important data in the computer was accidentally deleted by mistake, which can be quickly retrieved by this method
- After 3 years of testing bytecan software, I was ruthlessly dismissed in February, trying to wake up my brother who was paddling
- Spark Tuning (II): UDF reduces joins and judgments
- JDBC programming of MySQL database
- Coscon'22 community convening order is coming! Open the world, invite all communities to embrace open source and open a new world~
- ArrayExpress数据库里的细胞只有两个txt是不是只能根据Line到ENA下载测序跑矩阵?
- 电脑重装系统u盘文件被隐藏要怎么找出来
- Per capita Swiss number series, Swiss number 4 generation JS reverse analysis
- Unity 颜色板|调色板|无级变色功能
猜你喜欢

js对JSON数组的增删改查

内网穿透zerotier 外网(手机、电脑等)访问内网设备(树莓派、NAS、电脑等)

Yaduo Sangu IPO

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

I've been laid off, and I'll lose money for everything. The days when I once made a monthly salary of 20000 are not coming back

The best sister won the big factory offer of 8 test posts at one go, which made me very proud

浅谈现在的弊端与未来的发展

资产安全问题或制约加密行业发展 风控+合规成为平台破局关键

Use mitmproxy to cache 360 degree panoramic web pages offline

matplotlib画柱状图并添加数值到图中
随机推荐
Please help xampp to do sqlilab is a black
【OFDM通信】基于深度学习的OFDM系统信号检测附matlab代码
食品里的添加剂品种越多,越不安全吗?
js對JSON數組的增删改查
Laravel8 uses passport authentication to log in and generate a token
Realize colorful lines and shape your heart
Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million
[communication] optimal power allocation in the uplink of two-layer wireless femtocell network with matlab code
英国都在试行4天工作制了,为什么BAT还对996上瘾?
(1) Chang'an chain learning notes - start Chang'an chain
Station B Big utilise mon monde pour faire un réseau neuronal convolutif, Le Cun Forward! Le foie a explosé pendant 6 mois, et un million de fois.
Coscon'22 community convening order is coming! Open the world, invite all communities to embrace open source and open a new world~
[OFDM communication] OFDM system signal detection based on deep learning with matlab code
How can Oracle CDC deserialize with jsondebeziumdeserializationschema
求帮助xampp做sqlilab是一片黑
MySQL implementation of field segmentation from one line to multiple lines of example code
Devsecops software R & D security practice - release
Per capita Swiss number series, Swiss number 4 generation JS reverse analysis
ArrayExpress数据库里的细胞只有两个txt是不是只能根据Line到ENA下载测序跑矩阵?
Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform