Re: [SQL] Newbie questions

From: Postgres DBA <postgres(at)nest(dot)bistbn(dot)com>
To: Remigiusz Sokolowski <rems(at)gdansk(dot)sprint(dot)pl>
Cc: Frank Morton <fmorton(at)base2inc(dot)com>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Newbie questions
Date: 1998-12-14 11:28:55
Message-ID: Pine.BSF.4.02.9812141326580.5103-100000@nest.bistbn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

About LIMIT:
it is implemented as feature add-on to 6.4 release and could be downloaded
from patch directory on Postgres FTP site.

Al.

On Mon, 14 Dec 1998, Remigiusz Sokolowski wrote:

> > Question #1
> >
> > If a select might match MANY rows, how can I limit it to say 50?
> >
> > I thought you could do:
> >
> > select * from table limit 50;
>
> look at description of cursor in man - there are also examples
> begin work;
> declare cursor bookmark for
> your select statement;
> fetch 50 in bookmark;
> close bookmark;
> commit;B
>
> >
> > Question #2
> >
> > In doing a select, is there a way to ignore if the case of the key?
> >
> > For example, if I have a table called animals with an id column and
> > it might contain "dog" or "DOG" or "Dog" and I want to match all
> > of them, how do I do it, with or without the "like" operator?
> >
> > I'd like to say:
> >
> > select * from animals where id='dogs' ignore case;
>
> look at operators in docs
> ~~ - LIKE operator
> ~* - match(regex), case insensitive operator
> I have no idea which is better
> Rem
> p.s. I could make some mistakes in this examples - check in amnual or docs
> --------------------------------------------------------------------------------
> Remigiusz Sokolowski e-mail: rems(at)gdansk(dot)sprint(dot)pl
> --------------------------------------------------------------------------------
>
>
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sferacarta Software 1998-12-14 14:11:56 Re[2]: [SQL] Howto format a float8 number?
Previous Message Remigiusz Sokolowski 1998-12-14 08:26:18 Re: [SQL] Newbie questions