| From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
|---|---|
| To: | Rado Petrik <r(dot)p(at)szm(dot)sk> |
| Cc: | PostgreSQL-mailinglist <pgsql-sql(at)postgresql(dot)org> |
| Subject: | Re: What is bad in this query ? |
| Date: | 2003-05-02 19:07:56 |
| Message-ID: | Pine.LNX.4.44.0305021705440.19233-100000@matrix.gatewaynet.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On 2 May 2003, Rado Petrik wrote:
> Hi,
>
> What is bad in this query ?
>
> SELECT CASE
> WHEN EXIST(SELECT * FROM user WHERE name=rado)
> THEN (INSERT INTO user VALUES('rado'))
> END;
>
> PostgreSQL return
>
> ERROR: parser: parse error at or near "INTO"
>
> table user have only one column 'name' .
What do you want to do in the first place??
Have N+1 rows with name='rado' if N>0 ???
>
>
>
>
> Thanks
>
>
--
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-210-8981112
fax: +30-210-8981877
email: achill(at)matrix(dot)gatewaynet(dot)com
mantzios(at)softlab(dot)ece(dot)ntua(dot)gr
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chris Gamache | 2003-05-02 20:46:54 | Re: What is bad in this query ? |
| Previous Message | Achilleus Mantzios | 2003-05-02 19:03:21 | Re: [SQL] 7.3 analyze & vacuum analyze problem |