Dmitry Teslenko wrote:
>> richardh=> SELECT * FROM chartbl WHERE c LIKE '111';
>> c
>> ---
>> (0 rows)
>>
>> richardh=> SELECT * FROM chartbl WHERE c LIKE '111 ';
>> c
>>
>> 111
>> (1 row)
>>
>> richardh=> SELECT * FROM chartbl WHERE c LIKE '111%';
>> c
>>
On Mon, Nov 10, 2008 at 18:14, Richard Huxton <[EMAIL PROTECTED]> wrote:
> Dmitry Teslenko wrote:
>> Hello!
>> There's table:
>> CREATE TABLE table1 (
>> field1 CHARACTER(10),
>> ...
>> );
>>
>> Then there's record: INSERT INTO table1(field1, ..) VALUES ('111', ...);
>>
>> Then I query
Richard Huxton <[EMAIL PROTECTED]> writes:
> Dmitry Teslenko wrote:
>> When is LIKE no records matches query, when is =
>> my record matches query. Why? And Does this behavior varies from
>> PostgreSQL 7.4 to 8.1?
> You're comparing a 3-character value '111' of type text to a
> 10-character one
Dmitry Teslenko wrote:
> Hello!
> There's table:
> CREATE TABLE table1 (
> field1 CHARACTER(10),
> ...
> );
>
> Then there's record: INSERT INTO table1(field1, ..) VALUES ('111', ...);
>
> Then I query it:
> SELECT * FROM table1 WHERE field1 '111';
>
> When is LIKE no records match
Hello!
There's table:
CREATE TABLE table1 (
field1 CHARACTER(10),
...
);
Then there's record: INSERT INTO table1(field1, ..) VALUES ('111', ...);
Then I query it:
SELECT * FROM table1 WHERE field1 '111';
When is LIKE no records matches query, when is =
my record matches query.