Re: [SQL] Subqueries in Non-SELECT Queries

2000-12-18 Thread Frank Joerdens
Christof Glaser wrote: [ . . . ] > since the where clause compares just one field for equality. You might > try IN instead of =, ie > > update index set level = 2 where parentid in ( select id from > index where level = 1 ); That was it! Thanks, Frank

Re: [SQL] Subqueries in Non-SELECT Queries

2000-12-17 Thread Tom Lane
Frank Joerdens <[EMAIL PROTECTED]> writes: > mpi=# update index set level = 2 where parentid = ( select id from > index where level = 1 ); > ERROR: More than one tuple returned by a subselect used as an expression. Apparently the subquery "select id from index where level = 1" is returning more

Re: [SQL] Subqueries in Non-SELECT Queries

2000-12-17 Thread Christof Glaser
Frank Joerdens wrote: > mpi=# update index set level = 2 where parentid = ( select id from > index where level = 1 ); > ERROR: More than one tuple returned by a subselect used as an > expression. mpi=# > > This is a recursive query, on a single table. Is that not possible? Hi Frank, as the err