查看“Oracle”的源代码
←
Oracle
跳转至:
导航
、
搜索
因为以下原因,你没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看并复制此页面的源代码:
==oracle中in和exists的区别== in 是把外表和内表作hash join,而exists是对外表作loop,每次loop再对内表进行查询。 一直以来认为exists比in效率高的说法是不准确的。如果查询的两个表大小相当,那么用in和exists差别不大。 如果两个表中一个较小,一个是大表,则子查询表大的用exists,子查询表小的用in。 ==常用SQL== <source lang="SQL"> select max(sn) from (select card_no, SUBSTR(card_no,5) as sn from xzh_card_no where card_no like '6688%') </source> ==Oracle字符串连接的方法== 和其他数据库系统类似,Oracle字符串连接使用“||”进行字符串拼接,其使用方式和MSSQLServer中的加号“+”一样。 比如执行下面的SQL语句: <source lang="SQL"> SELECT '工号为'||FNumber||'的员工姓名为'||FName FROM T_Employee WHERE FName IS NOT NULL </source> 除了“||”,Oracle还支持使用CONCAT()函数进行字符串拼接,比如执行下面的SQL语句: <source lang="SQL"> SELECT CONCAT('工号:',FNumber) FROM T_Employee </source> ==oracle数据库导出、导入== <source lang="bash"> exp xzh/xzh@192.168.0.58/orcl file=xzh.dmp tables=cp_code_type, cp_code, pf_company2, xzh_card, xzh_card_no, xzh_card_no_gen_batch, xzh_card_package, xzh_card_package_dtl, xzh_service, xzh_service_mapping, xzh_supplier, xzh_supplier_org, xzh_supplier_service xzh_users imp tom/123@192.168.0.109:49161/xe file=~/xzh.dmp full=y </source> ;数据导出: 1 将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中 <source lang="bash"> exp system/manager@TEST file=d:\daochu.dmp full=y </source> 2 将数据库中system用户与sys用户的表导出 <source lang="bash"> exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys) </source> 3 将数据库中的表table1 、table2导出 <source lang="bash"> exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2) </source> 4 将数据库中的表table1中的字段filed1以"00"打头的数据导出 <source lang="bash"> exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\" </source> ;数据的导入 1 将D:\daochu.dmp 中的数据导入 TEST数据库中。 <source lang="bash"> imp system/manager@TEST file=d:\daochu.dmp </source> 上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。在后面加上 ignore=y 就可以了。 2 将d:\daochu.dmp中的表table1 导入 <source lang="bash"> imp system/manager@TEST file=d:\daochu.dmp tables=(table1) </source>
返回
Oracle
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息