Re: Odd query behavior - Mailing list pgsql-sql

From silly sad
Subject Re: Odd query behavior
Date
Msg-id 4B9E1995.2060008@bankir.ru
Whole thread Raw
In response to Odd query behavior  ("Dan McFadyen" <danm@cryptocard.com>)
List pgsql-sql
On 03/12/10 18:41, Dan McFadyen wrote:
> Hello,
>
> I've come across an odd situation. I've had access to a database where a
> the following happens:
>
> " SELECT * FROM table WHERE name LIKE 'abc%' " returns 2 rows...
>
> but...
>
> " SELECT * FROM table WHERE name IN (SELECT name FROM table WHERE name
> LIKE 'abc%') " returns 0 rows...

I am sorry if it was already spoken.

SELECT name FROM table WHERE name LIKE 'abc%'

EXPLAIN SELECT name FROM table WHERE name LIKE 'abc%'

EXPLAIN SELECT * FROM table WHERE name IN
(SELECT name FROM table WHERE name LIKE 'abc%')




pgsql-sql by date:

Previous
From: silly sad
Date:
Subject: Re: Private functions
Next
From: Tom Lane
Date:
Subject: Re: Odd query behavior