Skip site navigation (1) Skip section navigation (2)

Re: > and >= give the same result

From: Frank Bax <fbax(at)sympatico(dot)ca>
To:
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: > and >= give the same result
Date: 2011-12-29 15:39:41
Message-ID: 4EFC89BD.9080502@sympatico.ca (view raw or flat)
Thread:
Lists: pgsql-novice
On 12/29/11 10:19, Jean-Yves F. Barbier wrote:
> On Thu, 29 Dec 2011 08:48:37 -0500
> Frank Bax<fbax(at)sympatico(dot)ca>  wrote:
>
>>
>> The string 'y%' is greater than 'y'! Therefore, both queries will return
>> y% and z% - where is the problem?
>
> Oops, I'm read too fast; but it dont change my PB:
> SELECT * FROM table WHERE col>  'Y%' still returns y%&  Y%
>

NO.  It does not.

create table barbier (col varchar);
insert into barbier values ('y%');
insert into barbier values ('z%');
insert into barbier values ('Y%');
  select * from barbier where col>'Y%';
  col
-----
  y%
  z%
(2 rows)

In response to

Responses

pgsql-novice by date

Next:From: Jean-Yves F. BarbierDate: 2011-12-29 16:04:08
Subject: Re: > and >= give the same result
Previous:From: Jean-Yves F. BarbierDate: 2011-12-29 15:30:44
Subject: Re: > and >= give the same result

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group