Oracle中的一些基本使用示例

如果存数据类型:float
update dbo.a set e = round(b*c,2)
如果存数据类型:numeric
update dbo.a set d = convert(numeric(16,2),round(b*c,2))

to_char的转换:
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') ORACLE_TIME from dual;

select to_char(sysdate,'yyyy-mm-dd hh:mi:ss') ORACLE_TIME from dual;

将flag字段进行修改:
select name,decode(flag,'1','是','2','否','3','未定') from v_1

将2张表中的数据进行合并:
select * from a union (all)
 select * from b
union将去除相同记录,union all全部合并


将表中node_id字段长度为2的查出。
select * from tel_resource where length(node_id)=2

posted on 2005-10-10 10:35  冷月孤峰  阅读(253)  评论(0)    收藏  举报