Thread: RE: [SQL] using matches on int4

RE: [SQL] using matches on int4

From
"Jackson, DeJuan"
Date:
if you want to match all id's that start with 2 try [you might also what
to create a functional index on id as text(id)]:
 select * from users where id::text ~~ (2::text || '%');
or
 select * from users where id::text ~ ('^' || 2::text);
if you are trying to get exactly 200 use:
 select * from users where id=200;

    -DEJ


> -----Original Message-----
> On Thu, 4 Feb 1999, Jackson, DeJuan wrote:
>
> > What kind of matching are you trying to do?
> > Most likely you don't really need to create an operator.
>
> I was trying to find all people with ids of 200.
>
> -Greg
>