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

oracle 查询,以及效率考虑

现有一个表A
内容如下

name  index  purview
小王    1      3

表B

    id  type  way
    1  首页  任何人
    2  首页  隐藏
    3  娱乐  仅好友
    4  娱乐  任何人
想要结果:
  name type  way  type  way
小王    首页 任何人 娱乐 仅好友




SQL code:
select aa.name,aa.type,aa.way,bb.type,bb.way
(select a.name,b.type,b.way from a,b where a.index=b.id) aa,
(select a.name,b.type,b.way from a,b where a.purview=b.id) bb,
where aa.name=bb.name


最好表名不要用关键字!


谢谢楼上的关心,哈哈,我是举例,从来不用~~~~`

select aa.name,aa.type,aa.way,bb.type,bb.way
(select a.name,b.type,b.way from a,b where a.index=b.id) aa,
(select a.name,b.type,b.way from a,b where a.purview=b.id) bb,
where aa.name=bb.name
对的

select aa.name,aa.type,aa.way,bb.type,bb.way from
(select a.name,b.type,b.way from a,b where a.index=b.id) aa,
(select a.name,b.type,b.way from a,b where a.purview=b.id) bb
where aa.name=bb.name

#1楼写的漏掉东西~~~

还有更好的方法吗??~~~



相关问答:

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 ......

跪求 lomboz eclipse 中加入oracle的问题

在lomboz eclipse中的window->show view->others->中的怎样加入connectivity中的data source中连接oracle时只有8,9,10这三个版本,怎样才能连接oracle11这个版本呢??????????????
附图片 ......

oracle性能问题

想请教:
硬件:
    CPU:两颗4核,2.88
环境:
    redhat linux as 4.8 x86_64;  oracle 10g 10.2.0.1.0 for linux x86_64
    CPU:      In ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号