<?xml version="1.0" encoding="windows-1252"?>
<node id="723673" title="Re: find difference in dates/items in same column" created="2008-11-14 10:04:28" updated="2008-11-14 10:04:28">
<type id="11">
note</type>
<author id="85580">
dragonchild</author>
<data>
<field name="doctext">
While I can't offer any better solutions (because I haven't really spent any time thinking on the problem), it might help to know &lt;i&gt;why&lt;/i&gt; you're having issues. In relational theory, a SELECT statement is a view transformation on each row in the resulting (often temporary) table from the JOIN clause (modified by the GROUP BY clause). The WHERE clause is a limiter on that table. Given that you want to do a transformation crossing rows, that's where your problem is. Essentially, you need to create a table where the column you're interested in appears twice in each row so that your SELECT function can work on a given row.
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-85580"&gt;
&lt;hr&gt;
My criteria for good software:
&lt;ol&gt;
&lt;li&gt;Does it work?
&lt;li&gt;Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
&lt;/ol&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
723592</field>
<field name="parent_node">
723592</field>
</data>
</node>
