oracl 和db2 常用语法比较: 1、取前N条记录 Oracle:Select * from TableName where rownum <= N; DB2:Select * from TableName fetch first N rows only; 2、取得系统日期 Oracle:Select sysdate from dual; DB2:Select current timestamp from sysibm.sysdummy1; 3、空值转换 Oracle:Select
需求
查询某个字段的时候需要给一个字段同样的值。
这个值你可以写死,也可以从数据库获取
1、写死值
SELECT
mfr_id AS mfrId,
mfr_name AS mfrName,
IFNULL(NULL, 587694978080178176) AS suppId
FROM
mater_prod materProd
查询结果
2、从数据库获取值
SELECT
mfr_id AS mfrId,
mfr_name AS mfrName,
IFNULL(NULL, mfr