increment/rank

From: "Dan Harrington" <dan(at)tudan(dot)net>
To: <dan(at)tudan(dot)net>
Subject: increment/rank
Date: 2000-12-20 02:29:33
Message-ID: PPELIKJMPHIIPOBOPEKGKEIODCAA.dan@tudan.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am looking for a way to create an increment value for an image
database....
using an SQL database...let's say of some bodies of water:

table water
----------------------------------------------------------------------------
-
image title | URL | keywords | rank
----------------------------------------------------------------------------
-
Peaceful Stream | image/stream.jpg | water peace | 102
Wide Stream | image/wide.jpg | water peace flowing | 101
Rushing River | image/river.jpg | water rushing river | 100
Deep Ocean | image/ocean.jpg | water tide ocean | 99
Dashing Waterfall | image/falls.jpg | water fall cliff | 98

select * from water where keywords like '%water%' and keywords like
'%peace%' order by rank;

I get a two-record list of:
----------------------------------------------------------------------------
-
Peaceful Stream | image/stream.jpg | water peace | 102
Wide Stream | image/wide.jpg | water peace flowing | 101
----------------------------------------------------------------------------
-
...and I select "Wide Stream", I want to change the rank number from 101 to
102.

etc etc etc.

any ideas? I have searched far and wide in the documentation and I am
not seeing the answer aside from just duplicating the entire row
and incrementing the rank number, and then deleting the old record...but
that seems like a pathetic solution.

Thanks
Dan Harrington

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2000-12-20 02:48:09 Re: Re: [HACKERS] Trigger
Previous Message Dan Wilson 2000-12-20 02:24:33 Re: grant a db