On 29/04/2014 12:39, David Noel wrote:
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: '
" (double quotation mark) designates a column name, table name, and rest of database objects. ' (single quotation mark) designates a text literal e.g. 'john', 'david', etc... 'health'<>'' (if that is what you have) means a boolean expression that compares the literal 'health' with the empty literal '' which is of course always false. Maybe *health* is a column name somewhere ? In this case it should be written : "health" <> '' (i.e. comparison between the value of column "health" and the literal value '')
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 <[email protected]> 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
-- Achilleas Mantzios Head of IT DEV IT DEPT Dynacom Tankers Mgmt -- Sent via pgsql-general mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
