Re: SELECT Question

From: "Lada 'Ray' Lostak" <ray(at)unreal64(dot)net>
To: "Alex" <alex(at)meerkatsoft(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: SELECT Question
Date: 2003-11-20 07:45:53
Message-ID: 00c101c3af3a$539e19a0$0d01a8c0@utopia
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

> > Is there an easy way to write a select statement that returns me the
> > frist free number or any within the range of 200?
> > For example if 1-30, and 32-50 are occupied then i would like to fill in
> > the new entry with id 31.
> > I currently do it with a function but I was just wondering if there is a
> > way without it..
> If I understand well, what something about
>
> SELECT min(xxx) FROM table WHERE xxx<50
>
After I sent it, I saw I understand bad... Just woke up... Sorry :)

I personally think, you need small procedure do to that, because you want to
perform condition 'min(xxx)' on "unexisting" columns.

R.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lada 'Ray' Lostak 2003-11-20 07:52:15 "Transaction over connections"
Previous Message Shridhar Daithankar 2003-11-20 07:42:58 Re: Point-in-time data recovery - v.7.4

Browse pgsql-patches by date

  From Date Subject
Next Message Alex 2003-11-20 07:52:37 Re: SELECT Question
Previous Message Alex 2003-11-20 07:39:56 Re: SELECT Question