Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows) - Mailing list pgsql-general

From David Noel
Subject Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)
Date
Msg-id CAHAXwYCQjviAr13i8=6aR4McJSp3wqtFL6PB0SF=ajaVP_yjSA@mail.gmail.com
Whole thread Raw
In response to Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)  (David Noel <david.i.noel@gmail.com>)
Responses Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-general
Ehh, to clarify I'm referring to the lone _double_ quotation mark at
the end of the condition 'health'<>''. I called it a "single quotation
mark" because it was a quotation mark all by itself, but realize that
could be misread. Single quotation marks are technically this: '

Sorry for the newbie spam -- I can't run
less-than/greater-than/quotation marks through Google for answers.

On 4/29/14, David Noel <david.i.noel@gmail.com> wrote:
>> select p.*, s.NoOfSentences
>> from page p,
>>      lateral (select count(*) as NoOfSentences
>>               from sentence s
>>               where s."PageURL" = p."URL") s
>> where "Classification" like case ... end
>> order by "PublishDate" desc
>> limit 100;
>
> Great. Thanks so much!
>
> Could I make it even simpler and drop the case entirely?
>
> select p.*, s.NoOfSentences
> from page p,
>      lateral (select count(*) as NoOfSentences
>               from sentence s
>               where s."PageURL" = p."URL") s
> where "Classification" like 'health'
> order by "PublishDate" desc
> limit 100;
>
> I'm not sure what "case WHEN 'health'<>'' THEN 'health' ELSE '%' end"
> does. I follow everything just fine until I get to the 'health'<>''
> condition. What does the single quotation mark mean? I can't seem to
> find it in the documentation.
>
> -David
>


pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: WAL Replication + PITR
Next
From: Achilleas Mantzios
Date:
Subject: Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)