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 CAHAXwYCT8EGCz9f1Lsg_Lzn-f2yA3QupUOMAY3f3ogQwwMZz9Q@mail.gmail.com
Whole thread Raw
In response to Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)  (Vik Fearing <vik.fearing@dalibo.com>)
Responses Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)
List 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


pgsql-general by date:

Previous
From: basti
Date:
Subject: WAL Replication + PITR
Next
From: Albe Laurenz
Date:
Subject: Re: WAL Replication + PITR