当前位置: 动力学知识库 > 问答 > 编程问答 >

Unable to return a Row that contains xmldata from two joined views Oracle

问题描述:

I've got two views that have similar values. I'm attempting to return a row using a where clause however, no data is returning.

If I do a select * without the where clause, data is returned.

Order1 View:

CREATE VIEW AS Order1 SELECT OrderNumber, CAST(Longitude*16/180 AS number(38))

AS MapGridX1, CAST(Latitude*16/90 AS number(38)) AS MapGridY1, OrderData

FROM Order LEFT OUTER JOIN OrderAssociation ON Order.Id = OrderAssociation.OrderId;

Order2 View

CREATE VIEW AS Order2 SELECT OrderNumber, CAST(Longitude*16/180 AS number(38))

AS MapGridX1, CAST(Latitude*16/90 AS number(38)) AS MapGridY1, OrderData

FROM Order LEFT OUTER JOIN OrderAssociation ON Order.Id = OrderAssociation.OrderId;

SQL Call:

select Order2.* from Order2 join Order1 on Order2.Id = Order1.Id where Order2.MapGridX1 = 8

Order1 Table:

Id: 1

OrderData: {XMLDATA}

MapGridX1: 8

MapGridY1: 90

Order2 Table:

Id: 1

OrderData: {XMLDATA}

MapGridX1: 8

MapGridY1: 90

分享给朋友:
您可能感兴趣的文章:
随机阅读: