Re: LIKE problem

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Juan Pablo Cook <juampick(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LIKE problem
Date: 2009-07-06 06:15:03
Message-ID: 162867790907052315u7b23353yd53aeeced5ac604e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/7/6 Juan Pablo Cook <juampick(at)gmail(dot)com>:
> Hi Everybody!
> I'm asking you, because recently I have some problems with the LIKE so I
> test with an easy and simple query but doesn't work:
> SELECT *
> FROM employee
> WHERE id like 'h%';
> The error says:
> "ERROR:  operator does not exist: integer ~~ unknown

SELECT *
FROM employee
WHERE name like 'h%'; --<<<

there are not LIKE operator for integer values. you cannot use LIKE on
integer columns

regards
Pavel

>
> LINE 5: WHERE id like 'h%';
>
>                   ^
>
> HINT:  No operator matches the given name and argument type(s). You might
> need to add explicit type casts.
>
> ********** Error **********
>
> ERROR: operator does not exist: integer ~~ unknown
>
> SQL state: 42883
>
> Hint: No operator matches the given name and argument type(s). You might
> need to add explicit type casts.
>
> Character: 34"
>
> I don't know why because I did before more difficult querys and works well.
> What is the problem?
>
> Thanks a lot
>
> JP Cook

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2009-07-06 06:19:51 Re: LIKE problem
Previous Message CM J 2009-07-06 05:58:51 Postgres 8.3.7 Server Crash: failed to add item to the right sibling in index