易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle 9i 一对多的关系查询

一对多关系查询

表:
ea,eb,ga,gb
表关系如下
ea1=eb1
ga1=gb1
eb1=gb31 and eb3 = gb33


事例数据及关系如下:
SQL code:

SELECT ea1, eb3, gb1, gb3, gb31, gb33
from (SELECT 'G1' gb1, '1' gb3, 'E1' gb31, '1' gb33
from dual
UNION ALL
SELECT 'G1', '2', 'E1', '2'
from dual
UNION ALL
SELECT 'G2', '3', 'E2', '3'
from dual
UNION ALL
SELECT 'G1', '4', 'E1', '3'
from dual
UNION ALL
SELECT 'G2', '4', 'E1', '3'
from dual
UNION ALL
SELECT 'G2', '6', 'E2', '6'
from dual
UNION ALL
SELECT 'G3', '7', 'E2', '7'
from dual
UNION ALL
SELECT 'G4', '8', 'E2', '8' from dual) gb,
(SELECT 'G1' ga1
from dual
UNION ALL
SELECT 'G2'
from dual
UNION ALL
SELECT 'G3' from dual) ga,
(SELECT 'E1' eb1, '1' eb3
from dual
UNION ALL
SELECT 'E1', '2'
from dual
UNION ALL
SELECT 'E1', '3'
from dual
UNION ALL
SELECT 'E1', '4'
from dual
UNION ALL
SELECT 'E1', '5' from dual) eb,
(SELECT 'E1' ea1 from dual) ea
WHERE ea1 = eb1
AND ga1


相关问答:

PHP 连接Oracle 出错

<?php
  getenv("ORACLE_HOME");
  $conn=ocilogon("test","test","test_db");
  if($conn)  
  echo success;  
&nb ......

求助ORACLE批量清除表数据的问题 - Oracle / 开发

比如我有testA、testB、testC三个表
我现在需要写一个批处理或者脚本给别人 作用就是执行这段语句可以清除这三个表里面的数据 就是一个初始化的意思
哪位高人帮助下啊 一个数据库小白在此求救啦
SQL code:
......

Oracle 日期查询问题

我有一张表有个字段名称是starttime 类型是DATE ,其中有一行的值是"11:00:00",我想把这一列选出来,语句如下:
select * from routebanci where starttime='11:00:00' and routename='*** ......

Oracle 启动的问题

oracle not available
shared memory realm does not exist
请问高手这个问题如何解决?
http://www.inthirties.com/thread-109-2-1.html

指定下ORACLE_SID,ORACLE_HOME看看,不行就用1楼得方法了..

cm ......

连接其他机器的oracle.

    LY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.251)(PORT = 1521))
    )
    ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号