Re: [SQL] problem with view and case - please help

2000-07-21 Thread DalTech - CTE
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 LIK

Re: [SQL] problem with view and case - please help

2000-07-21 Thread Ange Michel POZZO
the idea of a funtion is a good idea, thanks a lot ! i am a newbie to sql, after some try, i have made a function like this : create function browser(text) returns text AS 'SELECT CASE WHEN $1 LIKE \'%MSIE 2.0;%\' THEN \'Internet Explorer 2.0\' WHEN $1 LIKE \'%MSIE 3.0;%\' THEN \'Internet Explor

Re: [SQL] problem with view and case - please help

2000-07-21 Thread Volker Paul
> CREATE VIEW browser > AS > SELECT > agent_i, > CASE > WHEN agent_i LIKE '%MSIE 2.0;%' THEN 'Internet Explorer 2.0' > ... > agent_i NOT LIKE '%compatible%' THEN 'Netscape' > WHEN agent_i LIKE 'Mozilla/5.0 %' AND agent_i NOT LIKE '%MSIE%' AND > agent_i NOT LIKE '%compatible%' THEN 'Netscape' > WHE

[SQL] problem with view and case - please help

2000-07-21 Thread Ange Michel POZZO
I repost my message because it seems that my previous post don't go on i use [PostgreSQL 6.5.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2] rpm version of Linux Mandrake 7.02 i try this query : [ange@ange ange]$ psql zonecommerce -h 192.0.1.84 -u -f toto.sql Username: postgres Password: DROP