Re: query

Lists: pgsql-general
From: "superboy143 (sent by Nabble(dot)com)" <lists(at)nabble(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: query
Date: 2006-02-07 09:47:00
Message-ID: 2798174.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I have a table in which I have a field with format like 100101. It has many values like 100101, 100102, 100103, 100201, 100202, 100301. I have to write a query such that I have to get only distinct values such that they contain only the substring I need. If I give 10 as substring, then it should return only 100101 or 100102 but not both i.e if the last two characters are not same it should not return both of them. It should return only values starting with 10 the middle two values should be distinct and the last two characters may be anything.

--
View this message in context: http://www.nabble.com/query-t1074934.html#a2798174
Sent from the PostgreSQL - general forum at Nabble.com.


From: Richard Huxton <dev(at)archonet(dot)com>
To: superboy143 <superboy143(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: query
Date: 2006-02-07 10:35:59
Message-ID: 43E8780F.4090705@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

superboy143 (sent by Nabble.com) wrote:
>
> I have a table in which I have a field with format like 100101.
[snip]

Try to restrict posting to one list at a time. I've replied on the SQL
list already to this message, and I think it's a better location for it.

--
Richard Huxton
Archonet Ltd