达梦 | Oracle |
---|---|
支持一些字段类型 | 不支持(具体哪些忘了) |
concat可以连接三个以上字符串 | 只能连接两个 |
ifnull() | nvl() |
left() | substr() |
sysdate() | sysdate |
存储过程: create or replace procedure a authid definer as declare var_1 varchar(200); var_2 integer; begin set var_1=‘select * from table1’; set var_2=5; execute immediate var_sql; end; | 存储过程: create or replace procedure a authid definer is var_1 varchar(200); var_2 integer; begin var_1:=‘select * from table1’; var_2:=5 execute immediate var_sql; end; |
只能一行一行加字段 | 可以在同一个ALTER语句中加多个ADD字段 |
给变量赋值,支持set var_sql=和var_sql:=两种方式 | 只支持var_sql:= |
调用其他存储过程要call | 不用call |
表别名可以加as | 数据表别名不能加as,列的别名可以加as |
字段长度<=30个字节 | |
字段别名若包含特殊符号,需要加引号 | |
SELECT * FROM ( select ‘测试’ as PNAME, count( * ) as CNT, ‘过滤语法测试’ as REMARK from test ) a WHERE a.PNAME = ‘98’ 查询结果: PNAME CNT REMARK 测试 0 过滤语法测试 若想实现右侧Oracle的过滤效果,需在内层加一个group by SELECT * FROM ( select ‘测试’ as PNAME, count(*) as CNT, ‘过滤语法测试’ as REMARK from test group by ‘测试’ ) a WHERE a.PNAME = ‘98’ | SELECT * FROM ( select ‘测试’ as PNAME, count(*) as CNT, ‘过滤语法测试’ as REMARK from test ) a WHERE a.PNAME = '98’ 查询结果:空 |
达梦数据库与Oracle语法对比
最新推荐文章于 2024-06-17 10:07:55 发布