1.查看Oracle的版本:
select * from product_component_version 2.查找表中某字段具有重复记录:
select * from tablename t where t.columnname in
(select columnname from tablename group by equdatasysid having(count(columnname ))>1); 3.创建已有表的相同表结构的表
a.(Oracle)
create table table_new as select * table_old where 1=2;--只创建新表
create table table_new as select * from table_old;----创建新表并加入旧表数据
b.(SQL Server)这个未实验过,如若有哪位同盟用的时候出错了,欢迎纠正,共同进步
select * into 新表 from 表
select * into 新表 from 表 where 1=2 --只要表结构 4.删除回车键
update tablename set columnname=replace(columnname,chr(10),'') [where子句]
其中的chr(10)表示回车键 5.判断日期中是否含有时分秒
columnname=trunc(columnname)如果相等,则表示不包含时分秒 6.decode函数
DECODE(value,if1,then1,if2,then2,if3,then3,...,else);