Re: [SQL] UPDATE subselect? - Mailing list pgsql-sql

From José Soares
Subject Re: [SQL] UPDATE subselect?
Date
Msg-id 37175024.21E29E50@sferacarta.com
Whole thread Raw
In response to UPDATE subselect?  (Chris Bitmead <chris.bitmead@bigfoot.com>)
List pgsql-sql
Take a look at PostgreSQL User's Guide
Chapter 10. Arrays

syntax:
INSERT INTO SAL_EMP   VALUES ('Bill',   '{10000, 10000, 10000, 10000}',   '{{"meeting", "lunch"}, {}}');

José

Chris Bitmead ha scritto:

> What is the correct syntax for this UPDATE?
>
> CREATE TABLE category (
>   name text,
>   image text,
>   url text,
>   parent oid[]
> );
> update category set parent = '{0,0}' where name='slr';
> So far so good...
> update category set parent[0] = (SELECT oid from mfr where
> name='canon');
> ERROR:  parser: parse error at or near "select"
>
> --
> Chris Bitmead
> http://www.bigfoot.com/~chris.bitmead
> mailto:chris.bitmead@bigfoot.com



pgsql-sql by date:

Previous
From: José Soares
Date:
Subject: Re: [SQL] Update on 6.5
Next
From: Chris Bitmead
Date:
Subject: Re: [SQL] UPDATE subselect?