之前做了一个公安系统,sql会麻烦一点,数据库用的oracle,也积累了一些sql常用的函数,也复习了一下oracle。
to_date('2000-01-01','yyyy-mm-dd hh24:mi:ss')--转时间格式
insert into zdcl_cl() select * from zdcl_new where 条件--从查询的数据插入到另一个表里
nvl(?,'11') --如果参数为空 就选择'11'
to_number(char [,fmt [,nlsparam] ]) --to_number()函数也是oracle中常用的类型转换函数之一
decode(name,条件1,值1,条件2,值2)--if(条件1) 值1;if(条件2)值2
UPDATE b SET (ClientName) = (SELECT name FROM a WHERE b.id = a.id) --update select
instr(string1, string2, start_position,nth_appearance)--字符串截取的位置
之后还知道dblink 一个数据库可以操作另一个数据库的一种使用,@username