Skip site navigation (1) Skip section navigation (2)

Re: problem with view and case - please help

From: "DalTech - CTE" <CTE(at)Dal(dot)Ca>
To: <poange(at)technologist(dot)com>
Cc: "Pgsql-sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: problem with view and case - please help
Date: 2000-07-21 15:06:27
Message-ID: 00d201bff325$3ea36b60$5911be86@cte.Dal.Ca (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-generalpgsql-sql
Instead of:

> WHEN $1 LIKE \'Mozilla/2.0 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape 2.0\'
> WHEN $1 LIKE \'Mozilla/2.02 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape 2.02\'
> WHEN $1 LIKE \'Mozilla/2.02E %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape 2.02E\'
> WHEN $1 LIKE \'Mozilla/3.0 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape 3.0\'
> WHEN $1 LIKE \'Mozilla/3.01 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape 3.01\'
> WHEN $1 LIKE \'Mozilla/3.02 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/3.03 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.0 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.03 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.04 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.05 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.06 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.07 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.08 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.5 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.51 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.6 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.61 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.7 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.71 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.72 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/4.73 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/5.0 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'
> WHEN $1 LIKE \'Mozilla/6.0 %\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
> LIKE \'%compatible%\' THEN \'Netscape\'


Why not use:

WHEN $1 LIKE \'Mozilla/%\' AND $1 NOT LIKE \'%MSIE%\' AND $1 NOT
LIKE \'%compatible%\' THEN \'Netscape\'

It should be true based on the rest of your function.

Cheers.


In response to

pgsql-sql by date

Next:From: Tom LaneDate: 2000-07-21 15:15:04
Subject: Re: Timestamp indexes
Previous:From: Mitch VincentDate: 2000-07-21 14:52:00
Subject: Timestamp indexes

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-07-23 05:57:40
Subject: Re: Damn bug!
Previous:From: Tom LaneDate: 2000-07-21 14:44:22
Subject: Re: postgres bug report

pgsql-general by date

Next:From: Silesky Marketing Inc, SupportDate: 2000-07-21 16:08:10
Subject: password encryption
Previous:From: Ange Michel POZZODate: 2000-07-21 14:41:06
Subject: Re: [SQL] problem with view and case - please help

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group