1 Reply Latest reply: Jul 3, 2014 3:01 PM by Stefan Jager RSS

    basic sdo_difference query

    996454

      I have two spatial tables, base_table and new_table:

       

      CREATE TABLE base_table (

           site_no NUMBER,

           geometry MDSYS.SDO_GEOMETRY);

       

       

      CREATE TABLE new_table (

           site_no NUMBER,

           geometry MDSYS.SDO_GEOMETRY);

       

      What I want to do output a geometry set which base_table.geometry MINUS new_table.geometry

       

      I have tried the following query but it does not give the result I wanted:

       

      SELECT b.site_no as base_site_no, n.site_no as new_site_no,

             SDO_GEOM.SDO_DIFFERENCE (b.geometry, n.geometry, 0.5) as new_geom

      FROM base_table b, new_table n;

       

      Where am I going wrong?

        • 1. Re: basic sdo_difference query
          Stefan Jager

          996454 wrote:

          Where am I going wrong?

          There's no way of knowing where you went wrong (IF you went wrong - your SQL looks fine to me) without a little more information. Things like:

           

          1. Your database version (select * from v&version)

          2. What did you expect? How is the result different from what you'd expect?

          3. Some sample data (2 or 3 records of both tables), with the result you would expect from those records

           

          Then we might be able to help you. Right now everything is guesswork, since we are not familiar with your data nor with your requirements.