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 13:48:37
Message-ID: 4EFC6FB5.8050201@sympatico.ca (view raw or flat)
Thread:
Lists: pgsql-novice
On 12/29/11 08:15, Jean-Yves F. Barbier wrote:
> Hi list,
>
> I'm trying to help a friend with his queries and I've something
> strange (well, to me:):
>
> SELECT * FROM tb1 WHERE note>  'y';
>
> returns the *same* result as:
>
> SELECT * FROM tb1 WHERE note>= 'y';
>
> There's something wrong: I though I'd have:
> 1st qry: z%
> 2nd qry: y% and z%
>
> What is wrong with using '>'&| '>=' with strings?
>
> I also know there's a page talking about that in the docs, but I
> can't find it.


The string 'y%' is greater than 'y'! Therefore, both queries will return 
y% and z% - where is the problem?

In response to

Responses

pgsql-novice by date

Next:From: Jean-Yves F. BarbierDate: 2011-12-29 14:29:07
Subject: Re: > and >= give the same result
Previous:From: Jean-Yves F. BarbierDate: 2011-12-29 13:15:05
Subject: > and >= give the same result

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