oracle sql积累

来源:互联网 发布:淘宝正确产品推广方法 编辑:程序博客网 时间:2024/06/04 18:49

之前做了一个公安系统,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) 值1if(条件2)值2UPDATE b   SET   (ClientName)    =   (SELECT name FROM a WHERE b.id = a.id) --update select  instr(string1, string2, start_position,nth_appearance)--字符串截取的位置

之后还知道dblink 一个数据库可以操作另一个数据库的一种使用,@username

0 0