oracle中using的用法是什么
2022-03-02 14:41:38
在oracle中,using用于简化连接查询,只有当查询是等值连接和连接中的列必须具有相同的名称与数据类型时,才能使用using关键字进行简化。
本教程操作环境:Windows10系统、Oracle 11g版、Dell G3电脑。
oracle中using的用法是什么
oracle 中 using关键字使用规则:
1.查询必须是等值连接。
2.等值连接中的列必须具有相同的名称和数据类型。
使用using关键字简化连接时,需要注意以下几点:
1.使用 table1表和 table2表中的字段列进行连接时,在using子句和select子句中,都不能为字段列指定表名或表别 名。
2.如果在连接查询时使用了两个表中相同的多个列,那么久可以在using子句中指定多个列名,形式如下:
select... from table1 inner join table2 using(column1,column2);
上述的语句相当于下面的语句:
select... from table1 inner join table2 on table1.column1=table2.column2 and table1.column2=table2.column2;
如果对多个表进行检索,就必须多次使用using关键字进行指定,形式如下:
select... from table1 inner join table2 using(column1) inner join table3 using(column2);
上述的语句相当于下面的语句:
select... from table1,table2,table3 where table1.column1=table2.column1 and table2.column2=table3.table2;
推荐教程:《Oracle视频教程》
以上就是oracle中using的用法是什么的详细内容,更多请关注dnjidi.com其它相关文章!
相关阅读
- postgresql的now()与Oracle的sysdate区别说明
- Oracle中Spool命令的使用方法实例
- oracle in长度限制的两个快速解决方法
- Oracle 批处理自动备份bat脚本语句的步骤详解
- inner join和left join之间的区别详解
- mysql、oracle默认事务隔离级别的说明
- oracle 存储过程返回 结果集 table形式的案例
- MySQL版oracle下scott用户建表语句实例
- oracle日期分组查询的完整实例
- Oracle使用like查询时对下划线的处理方法
- Oracle 轻量级实时监控工具 oratop详解
- 详解Oracle 中实现数据透视表的几种方法
- ORACLE数据库对long类型字段进行模糊匹配的解决思路
- Oracle 数据仓库ETL技术之多表插入语句的示例详解
- zabbix agent2 监控oracle数据库的方法
- 详解Mysql和Oracle之间的误区
- oracle是什么公司
- oracle数据库免费吗