select 2*3 from dual; --计算一个比较纯的数据
select name||age from emp;--拼接select name||'abc' from emp;--字符串的连接select * from emp where name like '%/%%'; --转义字符,带有%的字符select * from emp where name like '%$%%' escape '$'; --转义字符,带有%的字符select * from emp order by name asc, age desc;--首先按照 name 升序,当相同时,内部再按照age降序select lower(name) from emp;select * from emp where lower(name) like '_a%';select substr(name,2,3) from emp;--将搜索的字段从第二个字母开始截,一共截取3个select chr(65) from dual;--Aselect * from ascii('A') from dual;--65select round(23.232) from dual; --四舍五入select round(23.232,2) from dual;--2位小数,-1到十位,0个位select to_char(sal,'$99,999.99') from emp;--$xxx.xx 2位小数select to_char(sal,'L99,999.99') from emp;--¥xxx.xx 2位小数select to_char(sal,'L00,0000.00') from emp;--¥00,0000.00 位数不够补零select to_char(sysdate,'yyyy-MM-DD HH24:MI:SS') from dual ; -- 有24则为24时制,nvl(sal,0) -- null取 0