Oracle数据库表嵌套查询问题
目前有两张表
type
--------------------
ID | Name
--------------------
1 | 林地
--------------------
2 | 耕地
--------------------
ground
ID | oldtype | nowtype
----------------------------------------
1 | 1 | 2
----------------------------------------
2 | 2 | 1
----------------------------------------
目标是生成以下视图
sv_GroundType
----------------------------------------
ID | oldtype | nowtype
----------------------------------------
1 | 林地 | 耕地
----------------------------------------
2 | 耕地 | 林地
----------------------------------------
语句:
create or replace view sv_GroundType as
select oldid ID,oldname oldtype,nowname nowtype
from
(select a.id oldid,b.name oldtype from ground a,type b where a.oldtype=b.id),
(select c.id newid,d.name nowname from ground c,type d where a.nowtype=b.id)
where oldid = newid
不知道如何精确描述这样的问题,先这样记下来吧,希望能对看到的人有所帮助。
更高级点的写法:
SELECT
Type_1.TypeName,
Type.TypeName,
Ground.ID,
Ground.LYR_SEQ,
Layer.LayerName,
from
Layer
RIGHT JOIN
(((Ground
INNER JOIN
Ground AS Ground_1
ON Ground.ID = Ground_1.ID)
INNER JOIN Type
ON Gr
相关文档:
windows上存在32bit的限制,如AIX、HP UNIX 等有明确的64BIT OS and ORACLE的版本,32bit oracle可以装在64bit os 上,64 bit oracle不能装在32 bit OS上
oracle是64bit or 32 bit,32bit 通常 SGA有 1.7G 的限制(某些OS的处理或者WINDOWS上有特定设定可以支持到2G以上甚至达到3.7G
如何查出前台正在发出的sql语句:
sele ......
'-------------------------------------------------------------------以下是登录代码
<%@ page contentType="text/html; charset=gb2312"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3 ......
自己在做这个程序的时候看过很多的资料,上网也查了不少的资料,可是多半说的是出神入化,云里雾里...不光看了不明白,而且是有明白一点的人,看了也变的有些模糊了。
这里我掩饰一套完整的java jdbc 连接Oracle9i的范例。
package com.lxh.dbcon;//打包
import ......
SQLServer和Oracle的常用函数对比
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) valu ......
只是sqlserver 提供的远程数据访问函数; 在本地sqlserver 中取外部数据源数据时候可用;
对连接本地 oracle 操作远程 oracle 不能使用; 测试: pl/sql 中使用:
select * from openrowset(................); 无效!!!!!!!!!!!!!!
在oracle 中需要访问远程数据,需要建立一连接远程oracle 的 dblink ;
再用如下方 ......