文章分类 -  Database

SQL各种连接查询详解(左连接、右连接..)
摘要:一、交叉连接(crossjoin)交叉连接(crossjoin):有两种,显式的和隐式的,不带on子句,返回的是两表的乘积,也叫笛卡尔积。例如:下面的语句1和语句2的结果是相同的。语句1:隐式的交叉连接,没有crossjoin。selecto.id,o.order_number,c.id,c.namefromorderso,customerscwhereo.id=1;语句2:显式的交叉连接,使用crossjoin。selecto.id,o.order_number,c.id,c.namefromordersocrossjoincustomerscwhereo.id=1;语句1和语句2的结果是相 阅读全文

posted @ 2013-04-04 11:16 神武大王 阅读(82) 评论(0) 推荐(0)

【ORA-02049】超时分布式事务处理等待锁 解决方法
摘要:(1)以sys用户登陆数据库查询死锁:SQL> select username,lockwait,status,machine,program from v$session where sid in(select session_id from v$locked_object);(2)然后使用一下语句查找被死锁的语句SQL> select sql_text from v$sql where hash_value in(select sql_hash_value from v$session where sid in (select session_id from v$locked_ 阅读全文

posted @ 2013-03-26 13:07 神武大王 阅读(2073) 评论(0) 推荐(0)

导航