Skip site navigation (1) Skip section navigation (2)

Is there a string to inet function that can be used in order by ?

From: "Richard DeVenezia" <radevenz(at)ix(dot)netcom(dot)com>
To: "sqllist" <pgsql-sql(at)postgresql(dot)org>
Subject: Is there a string to inet function that can be used in order by ?
Date: 2000-11-24 14:24:19
Message-ID: 001b01c05622$3cf24100$0101a8c0@supermicro (view raw or flat)
Thread:
Lists: pgsql-sql
I have a table of strings categorized by string type and unique id

e.g.

stringTypes table (sType, sDescription)
0 vanilla
1 ip address
2 mail address

stringValues table (sId, sType, sValue)
1 0 foobar
2 2 123 Main Street
3 1 123.123.123.123
3 1 123.13.123.123

I want to select ip address type strings and order them by ip address.  However I can not find a function that returns an inet given a string.

e.g.

select sValue from stringValues A, stringTypes B
where A.sType = B.sType and B.sType = 1
order by [**** function that converts string to INET ****] (A.sValue);

TIA

Richard DeVenezia

pgsql-sql by date

Next:From: Serge CanizaresDate: 2000-11-24 14:46:07
Subject: Re: Statement too long
Previous:From: rocaelDate: 2000-11-24 11:12:26
Subject: problems with postmaster

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group