数据库

本文对比了Oracle、SQL Server、MySQL、PostgreSQL和DB2这五种数据库管理系统在端口使用、自动生成主键、分页查询及默认最大连接数等方面的差异。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Oracle,SQLserver,mySQL,postgreSQL,DB2区别

 

 1.端口

Oracle----1521

SqlServer---1433

MySQL-----3306

postgreSQL-----5432

DB2-----50000

 

2.自动生成主键

Oracle----sequence---select seq.nextval from dual;select seq.currval from dual;

SqlServer---identity(1,1)--studentId int primary key identity(1,1),

MySQL-----auto_increment ----studentId int primary key auto_increment,

postgreSQL-----sequence--------select currval('seq');select nextval('seq')

 

3.分页查询11-15

Oracle----select * from (select rownum rm,e.* from emp e) where rownum<=5 and rm>=11;

SqlServer---select top 5 * from student where sno not in (select top 10 sno from student);

MySQL---select * from student limit 10,5;(limit 5 offset 10)

postgreSQL---select * from student limit 5 offset 10;

DB2----select * from (select a.* ,rownumber() over() as rowid from emp a) as p where 

 p.rowid > 10 AND p.rowid < 16;

 

4.默认最大连接数

MySql---100

Oracle---150

PostgreSql---100

 

5.常用sql

mysql--select * from student limit 10 --查询前十条

oracle-- select * from student where rownum<=10 --查询前十条

         select * from student where rownum=1 --这样可以,rownum=2不支持

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值