﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Manifold Community Site: Easy question regarding query building from new user</title><link>http://georeference.org/forum/t116324</link><description>Manifold Community Site thread</description><image><url>http://georeference.org/forum/images/img-feedhead.png</url><title>Manifold Community Site: Easy question regarding query building from new user</title><link>http://georeference.org/forum/t116324</link></image><item><title>RE: Easy question regarding query building from new user</title><link>http://georeference.org/forum/t116324#116325</link><description>&lt;P&gt;I've been using these forums for a few months now as I have been learning Manifold. All great information and helpful. Thank you.&lt;/P&gt;&lt;P&gt;That said, I've run into an issue as I'm trying to build a query. Essentially, I have 2 tables. Each contains a column of zip codes. I'm looking to determine which zips from T1 aren't in T2, and which from T2 aren't in T1. Two different queries.&lt;/P&gt;&lt;P&gt;I haven't gotten very far. I tried doing something like (with C being the column containing the zip codes in the different tables) &lt;/P&gt;&lt;P&gt;SELECT* FROM T1, T2&lt;/P&gt;&lt;P&gt;WHERE Contains (T1.C1], (T2.C2)&lt;/P&gt;&lt;P&gt;That isn't getting me very far, as I'm sure the people that know what they're doing realize. Any ideas on how to solve this would be helpful! Thanks.&lt;/P&gt;</description><dc:creator>rnowak</dc:creator><comments>http://georeference.org/forum/t116324#116325</comments><guid>http://georeference.org/forum/t116324#116325</guid><pubDate>Mon, 11 Jun 2012 17:39:20 GMT</pubDate></item><item><title>RE: Easy question regarding query building from new user</title><link>http://georeference.org/forum/t116324#116326</link><description>&lt;P&gt;Hello @rnowak. Contains() is a spatial function only. Not what you want here.&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=c&gt;--SQL&lt;/span&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;SELECT&lt;/span&gt;&amp;#160;*&amp;#160;&lt;span class=k&gt;FROM&lt;/span&gt;&amp;#160;T1&amp;#160;&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span class=k&gt;WHERE&lt;/span&gt;&amp;#160;&lt;span class=k&gt;NOT&lt;/span&gt;&amp;#160;&lt;span class=k&gt;EXISTS&lt;/span&gt;&amp;#160;&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;(&lt;span class=k&gt;SELECT&lt;/span&gt;&amp;#160;*&amp;#160;&lt;span class=k&gt;FROM&lt;/span&gt;&amp;#160;T2&amp;#160;&lt;span class=k&gt;WHERE&lt;/span&gt;&amp;#160;T1.C1&amp;#160;=&amp;#160;T2.C2)&lt;/P&gt;&lt;P&gt;Is there an Excel or even an Access freak around who can do this in 3 lines of code?&lt;/P&gt;</description><dc:creator>KlausDE</dc:creator><comments>http://georeference.org/forum/t116324#116326</comments><guid>http://georeference.org/forum/t116324#116326</guid><pubDate>Mon, 11 Jun 2012 18:38:25 GMT</pubDate></item><item><title>RE: Easy question regarding query building from new user</title><link>http://georeference.org/forum/t116324#116327</link><description>&lt;P&gt;Here's the three lines of SQL. This  should give you both.&lt;/P&gt;&lt;P&gt;&lt;P class='code'&gt;&lt;P class='code'&gt;&lt;span class=k&gt;select&lt;/span&gt;&amp;#160;*&amp;#160;&lt;span class=k&gt;from&lt;/span&gt;&amp;#160;T1&amp;#160;&lt;span class=k&gt;FULL&lt;/span&gt;&amp;#160;&lt;span class=k&gt;OUTER&lt;/span&gt;&amp;#160;&lt;span class=k&gt;JOIN&lt;/span&gt;&amp;#160;T2&amp;#160;&lt;span class=k&gt;on&lt;/span&gt;&amp;#160;C1&amp;#160;=&amp;#160;C2&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;WHERE&lt;/span&gt;&amp;#160;C1&amp;#160;&lt;span class=k&gt;is&lt;/span&gt;&amp;#160;&lt;span class=k&gt;null&lt;/span&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;OR&lt;/span&gt;&amp;#160;C2&amp;#160;&lt;span class=k&gt;is&lt;/span&gt;&amp;#160;&lt;span class=k&gt;NULL&lt;/span&gt;&lt;/P&gt;&lt;/P&gt;&lt;/P&gt;&lt;P&gt;Finding those zips which appear in neither table is harder &lt;IMG SRC='images/emo-wink.gif'&gt;&lt;/P&gt;&lt;P&gt;If you just want a &amp;quot;one way&amp;quot; query, you can try:&lt;/P&gt;&lt;P&gt;&lt;P class='code'&gt;&lt;P class='code'&gt;&lt;span class=k&gt;select&lt;/span&gt;&amp;#160;T1.*&amp;#160;&lt;span class=k&gt;from&lt;/span&gt;&amp;#160;T1&amp;#160;&lt;span class=k&gt;LEFT&lt;/span&gt;&amp;#160;&lt;span class=k&gt;JOIN&lt;/span&gt;&amp;#160;T2&amp;#160;&lt;span class=k&gt;on&lt;/span&gt;&amp;#160;C1&amp;#160;=&amp;#160;C2&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;WHERE&lt;/span&gt;&amp;#160;C2&amp;#160;&lt;span class=k&gt;is&lt;/span&gt;&amp;#160;&lt;span class=k&gt;null&lt;/span&gt;&lt;/P&gt;&lt;/P&gt;&lt;/P&gt;&lt;P&gt;Hopefully you get the idea...&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;</description><dc:creator>mlinth</dc:creator><comments>http://georeference.org/forum/t116324#116327</comments><guid>http://georeference.org/forum/t116324#116327</guid><pubDate>Mon, 11 Jun 2012 19:37:49 GMT</pubDate></item><item><title>RE: Easy question regarding query building from new user</title><link>http://georeference.org/forum/t116324#116329</link><description>&lt;P&gt;These two replies have gotten me well on my way. &lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description><dc:creator>rnowak</dc:creator><comments>http://georeference.org/forum/t116324#116329</comments><guid>http://georeference.org/forum/t116324#116329</guid><pubDate>Mon, 11 Jun 2012 20:31:32 GMT</pubDate></item></channel></rss>