与Oracle对照表
注意需开启oracle兼容配置。
Oracle | TeleDB |
---|---|
Number | 对应smallint, integer, bigint, numeric(p,s) 等多种数据类型。由于 smallint,Integer,bigint的算术运算效率比numeric高得多,所以要视业务需要转换成对应的smallint, integer, bigint,无法转换时才转换成numeric(p,s) |
float | float(实际按照double precision 或 real存储) |
binary_float | binary_float(实际按照real存储) |
binary_double | binary_double(实际按照double precision存储) |
char | char |
nchar | char |
varchar2 | varchar2 |
nvarchar2 | nvarchar2 |
rowid | rowid |
urowid | urowid(teledb不支持) |
long | long(teledb不支持) |
clob | clob |
nclob | nclob(teledb不支持) |
blob | blob |
bfile | bfile(teledb不支持) |
long raw | long raw(teledb不支持) |
raw | raw(teledb不支持) |
date | date |
timestamp | timestamp |
interval | interval |
与MySQL 对照表
MySQL | TeleDB |
---|---|
int | int |
smallint | smallint |
bigint | bigint |
int AUTO_INCREMENT | serial |
smallint AUTO_INCREMENT | smallserial |
bigint AUTO_INCREMENT | bigserial |
bit | bit |
tinyint | smallint |
float | real |
double | double precision |
decimal | numeric |
char | varchar |
varchar | blob |
text | text |
date | date |
time | time |
datetime | timestamp |
longblob | bytea |
Longtext | text |
ENUM类型CREATE TABLE TYPE022(COL1 ENUM('S','M','L','XL','XXL','XXXL') ,COL2 INT PRIMARY KEY); | 自定义类型CREATE TYPE mood AS ENUM ('S','M','L','XL','XXL','XXXL');CREATE TABLE TYPE022(COL1 mood ,COL2 INT PRIMARY KEY) |
SET类型CREATE TABLE TYPE023(COL1 SET('A','B', 'C','D') ,COL2 INT PRIMARY KEY) | CREATE TABLE TYPE023(COL1 VARCHAR check(regexp_split_to_array(col1,',') <@ array['A','B','C','D']) ,COL2 INT PRIMARY KEY); |
与SQL Server对照表
SQL Server | TeleDB |
---|---|
int | int |
smallint | smallint |
bigint | bigint |
tinyint | smallint |
real | real |
float | double precision |
numeric | numeric |
bit | bit |
char | char |
nchar | char |
varchar | varchar |
nvarchar | varchar |
text | text |
ntext | text |
date | date |
time | time |
datetime | timestamp |
datetime2 | timestamp |
smalldatetime | timestamp |
datetimeoffset | timestamp |
uniqueidentifier | uuid |
image | bytea |
binary | bytea |
varbinary | bytea |