From: George Moga <george@flex.ro>
To: Gregory Holston <holston@itd.nrl.navy.mil>
To: SQL PostgreSQL <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] using matches on int4
Date: Thu, 04 Feb 1999 20:08:21 +0200
Message-ID: <36B9E215.C0FA3F0E@flex.ro> (raw)
References: <Pine.SUN.3.91.990204120927.10871E-100000@shell>
Gregory Holston wrote:
> Hi List,
> I tried to do this query:
> real=> select * from users where id ~ 2;
> ERROR: There is no operator '~' for types 'int4' and 'int4'
> You will either have to retype this query using an explicit cast,
> or you will have to define the operator using CREATE OPERATOR
> My question is how would I create an operator?
>
> Thanks in advance,
>
>
> -Greg
>
> .......
>
> I was trying to find all people with ids of 200.
>
> -Greg
>
If I undestund what do you want:
select * from users where %id/100 = 2;
This returns all records whith ids between [200 ... 299]
I use PostgbreSQL 6.4 on Red Hat Linux 5.2 with 2.2.0 kernel.
-------
Best,
George Moga,
george@flex.ro
Braila, ROMANIA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: george@flex.ro, holston@itd.nrl.navy.mil
Subject: Re: [SQL] using matches on int4
In-Reply-To: <36B9E215.C0FA3F0E@flex.ro>
References: <Pine.SUN.3.91.990204120927.10871E-100000@shell> <36B9E215.C0FA3F0E@flex.ro>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox