<DIV>Hi Regina,</DIV> <DIV>giving the link to show actual how the UNION of polygons is not working as per expectation.</DIV> <DIV>Please see the clips in the link.</DIV> <DIV> </DIV> <DIV> <DIV dir=ltr align=left><SPAN class=691344412-13092007><SPAN class=691344412-13092007><FONT face=Arial color=#0000ff size=2>CREATE TABLE abc(code smallint, info smallint) with oids;</FONT></SPAN></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=691344412-13092007><SPAN class=691344412-13092007><FONT face=Arial color=#0000ff size=2>SELECT AddGeometryColumn('public', 'abc', 'the_geom', 4326, 'MULTIPOLYGON', 2);</FONT></SPAN></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=691344412-13092007><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=691344412-13092007><FONT face=Arial color=#0000ff size=2>--The insert</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=691344412-13092007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=691344412-13092007><FONT face=Arial color=#0000ff size=2>INSERT INTO abc(code, info, the_geom)</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=691344412-13092007> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2>SELECT newtb.code, <A href="http://newtb.info/" target=_blank><SPAN id=lw_1190034122_1 style="BACKGROUND: none transparent scroll repeat 0% 0%"><FONT color=#003399>newtb.info</FONT></SPAN></A>, geomunion(newtb.cgeom) as thenewgeom</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2>FROM </FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2>( SELECT <SPAN class=691344412-13092007>a</SPAN>.code, <SPAN class=691344412-13092007><A href="http://b.info/" target=_blank><FONT color=#003399><SPAN
id=lw_1190034122_2>b</SPAN>.info</FONT></SPAN></A>, geomunion(<SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>, <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>) as cgeom</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial><FONT color=#0000ff><FONT size=2> FROM <SPAN class=691344412-13092007>a</SPAN></FONT></FONT></FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2> INNER JOIN <SPAN class=691344412-13092007>b</SPAN> ON <SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> && <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> AND intersects(<SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>, <SPAN
class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>)</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007> <FONT face=Arial color=#0000ff size=2>UNION ALL</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007> <FONT face=Arial color=#0000ff size=2>SELECT <SPAN class=691344412-13092007>a</SPAN>.code, null As info, <SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> as cgeom</FONT> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2> FROM <SPAN class=691344412-13092007>a</SPAN> </FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2> LEFT JOIN <SPAN class=691344412-13092007>b</SPAN> ON <SPAN class=691344412-13092007>a</SPAN>.geom<SPAN
class=691344412-13092007>etry</SPAN> && <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> AND intersects(<SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>, <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>)</FONT></SPAN></DIV></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2> WHERE <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> IS NULL</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007> <FONT face=Arial color=#0000ff size=2>UNION ALL</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007> <FONT face=Arial color=#0000ff size=2>SELECT null as code, <SPAN class=691344412-13092007><A href="http://b.info/"
target=_blank><FONT color=#003399><SPAN id=lw_1190034122_3>b</SPAN>.info</FONT></SPAN></A>, <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> as cgeom</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2> FROM <SPAN class=691344412-13092007>b</SPAN> LEFT JOIN <SPAN class=691344412-13092007>a</SPAN> ON <SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> && <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> AND intersects(<SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>, <SPAN class=691344412-13092007>b</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN>)</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff
size=2> WHERE <SPAN class=691344412-13092007>a</SPAN>.geom<SPAN class=691344412-13092007>etry</SPAN> IS NULL</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2>) AS newtb</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=217440812-13092007><FONT face=Arial color=#0000ff size=2>GROUP BY newtb.code, <A href="http://newtb.info/" target=_blank><SPAN id=lw_1190034122_4><FONT color=#003399>newtb.info</FONT></SPAN></A></FONT></SPAN></DIV></SPAN></DIV></DIV> <DIV> </DIV> <DIV>May be I should be using different syntax for such a result.</DIV> <DIV> </DIV> <DIV> </DIV> <DIV><A href="http://www.kodakgallery.com/I.jsp?c=cjns10h3.8ovw4dsn&x=0&y=w3kbw0" target=_blank rel=nofollow><SPAN id=lw_1190033901_2 style="BACKGROUND: #dceeff"><FONT face=Verdana color=#003399
size=1>http://www.kodakgallery.com/I.jsp?c=cjns10h3.8ovw4dsn&x=0&y=w3kbw0</FONT></SPAN></A><FONT face=Verdana size=1> </FONT></DIV> <DIV><FONT face=Verdana size=1></FONT> </DIV> <DIV><FONT face=Verdana size=1>Ravi Kumar</FONT></DIV><p>
<hr size=1>Catch up on <a href="http://us.rd.yahoo.com/tv/mail/tagline/falltv/evt=47093/*http://tv.yahoo.com/collections/3658
">fall's hot new shows</a> on Yahoo! TV. Watch previews, get listings, and more!