Re: select offset by alphabetical reference

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: "Dave [Hawk-Systems]" <dave(at)hawk-systems(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select offset by alphabetical reference
Date: 2003-05-07 06:19:00
Message-ID: 1052288340.17966.13.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2003-05-07 at 06:50, Dave [Hawk-Systems] wrote:
> Have a table with Last, First, etc...
> wish to create a select to grab everything from table whose last name is
> alphabetically greater than 'Smith'
>
> almost like the following (which is obviously incorrect);
> select last,first from mytable order by last offset 'Smith';
>
> ideas on how to handle this at the postgres level rather than grabbing all and
> storing it in an array in PHP/Perl for post processing to grab the desired
> records?

SELECT last, first FROM mytable WHERE last > 'Smith' ORDER BY last;

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Dearly beloved, avenge not yourselves, but rather give
place unto wrath. For it is written, Vengeance is
mine; I will repay, saith the Lord. Therefore if thine
enemy hunger, feed him; if he thirst, give him drink;
for in so doing thou shalt heap coals of fire on his
head. Be not overcome of evil, but overcome evil with
good." Romans 12:19-21

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-05-07 06:32:59 Re: Perl DBI::Pg - Stop button
Previous Message Dave [Hawk-Systems] 2003-05-07 05:50:47 select offset by alphabetical reference