<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 06/07/2012 09:14 AM, Hemin Tofiq wrote:
<blockquote cite="mid:1339074857062-4998074.post@n6.nabble.com"
type="cite">
<pre wrap="">Thank you,
I have 2 tables with the same structure, so we don't need to create alias
for the same table, however that is fine with updated rows, how can I get
newly created rows?
Regards,
Hemin
</pre>
</blockquote>
I assume you mean you have added a new row to one table but not the
"twin" table. <br>
<br>
Comparing on a unique key would look like:<br>
<br>
SELECT * <br>
FROM table1<br>
LEFT JOIN table2 ON (table1.unique_key = table2.unique_key)<br>
WHERE table2.unique_key IS NULL;<br>
<br>
I think you said you want to be able to do this on geometries. I
haven't tried this, but I assume something like this might work:<br>
<br>
SELECT * <br>
FROM table1<br>
LEFT JOIN table2 ON (ST_Equals(table1.the_geom, table2.the_geom))<br>
WHERE table2.the_geom IS NULL;<br>
<br>
Just make sure to read the docs on ST_Equals vs. ST_OrderingEquals
so that you know which comparison you want.<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://postgis.refractions.net/documentation/manual-1.5/ST_Equals.html">http://postgis.refractions.net/documentation/manual-1.5/ST_Equals.html</a><br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://postgis.refractions.net/documentation/manual-1.5/ST_OrderingEquals.html">http://postgis.refractions.net/documentation/manual-1.5/ST_OrderingEquals.html</a><br>
<br>
Best,<br>
--Lee<br>
<br>
<pre class="moz-signature" cols="72">--
Lee Hachadoorian
PhD, Earth & Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
<a class="moz-txt-link-freetext" href="http://freecity.commons.gc.cuny.edu">http://freecity.commons.gc.cuny.edu</a>
</pre>
</body>
</html>