order by a XML column

From: mclo(at)asia(dot)com (Chris)
To: pgsql-general(at)postgresql(dot)org
Subject: order by a XML column
Date: 2002-03-14 04:44:59
Message-ID: 2d44b924.0203132044.58a501d@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a table with a varchar column which store XML in this format :

<A>Value of A</A><B>Value of B</B><C>Value of C</C>

How can I sort the result by this column and the content of one of the tag.

e.g. The table has 2 rows :
row 1: <A>Man</A><B>Woman</B><C>Child</C>
row 2: <A>Tree</A><B>Flower</B></C>Plant</C>

If I sort by the tag "<B>", the result would be :
row 2
row 1

If I sort by the tag "<A>", the result would be :
row 1
row 2

Thanks & Regards,
Chris

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlo Florendo 2002-03-14 05:18:56 Queries from different databases
Previous Message Jeff Fitzmyers 2002-03-14 04:39:40 Re: Postgres on Apple hardware?