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:12:13
Message-ID: CAHAXwYCT8EGCz9f1Lsg_Lzn-f2yA3QupUOMAY3f3ogQwwMZz9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> 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 Albe Laurenz 2014-04-29 09:30:38 Re: WAL Replication + PITR
Previous Message basti 2014-04-29 08:46:38 WAL Replication + PITR