Oracle Using SDO AGGR UNION: Difference between revisions

From WickyWiki
Created page with "Example using SDO_AGGR_UNION and SDOAGGRTYPE, the sourcetable kaartblad contains the final result of dividing an area in squares and subsquares. Each resulting subsquare has a sq..."
 
m 1 revision
 
(No difference)

Latest revision as of 07:26, 5 July 2013

Example using SDO_AGGR_UNION and SDOAGGRTYPE, the sourcetable kaartblad contains the final result of dividing an area in squares and subsquares. Each resulting subsquare has a squareNr and a subsquareNr. The following query joins union of all subsquares of each squareNr

DROP TABLE Test;
CREATE TABLE Test (  Shape MDSYS.SDO_Geometry, INFORM VARCHAR2(400)  );

insert into test(shape, INFORM)
  select SDO_AGGR_UNION(SDOAGGRTYPE(t.shape, 0.00000005)), TRIM(TO_CHAR(Substr(t.bladnr,1,2),'00'))
    from kaartblad t
    group by squareNr
    order by squareNr;