Select records from XML column (SQL Server 2005) based on node order
- by jdoe
I have a column in a SQL Server 2005 table defined as an XML column. Is there a way to select records from this table based on the order of two nodes in that column? For example, we have the following structure in our XML:
<item>
<latitude/>
<longitude/>
</item>
I want to see if there are any records that have latitude/longitude in the opposite order i.e. <longitude/> then <latitude/>. I've tried some XPath expressions but with no luck.