Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)

From: David Noel <david(dot)i(dot)noel(at)gmail(dot)com>
To: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
Cc: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)
Date: 2014-04-29 09:39:04
Message-ID: CAHAXwYCQjviAr13i8=6aR4McJSp3wqtFL6PB0SF=ajaVP_yjSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)i(dot)noel(at)gmail(dot)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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2014-04-29 09:45:20 Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)
Previous Message Albe Laurenz 2014-04-29 09:30:38 Re: WAL Replication + PITR