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
废话不多了,直接贴代码了
一查询数值型数据:
SELECT * FROM tb_name WHERE sum > 100;
查询谓词:>,=,<,,!=,!>,!,=<
二查询字符串
SELECT * FROM tb_stu WHERE sname = '小刘'
SELECT * FROM tb_stu WHERE sname like '刘%'
SELECT * FROM tb_stu WHERE sname like '%程序员'
SELECT
代码如下: select count(*) as lot from OA_sample_check where left(ecnNO, LOCATE(‘,’,ecnNO)-1)=’a1′
您可能感兴趣的文章:从一个MySQL的例子来学习查询语句mysql分页原理和高效率的mysql分页查询语句mysql查询语句通过limit来限制查询的行数mysql优化limit查询语句的5个方法优化MySQL数据库中的查询语句详解整理MySql常用查询语句(2