Subject | RE: [firebird-support] Basic SQL Update query question |
---|---|
Author | Alan McDonald |
Post date | 2006-11-01T14:40:58Z |
update collection COL
set COL.disp_browse = 'N'
where COL.user_no in (select u.user_no from user_account u where
u.expire_date = cast('NOW' as date));
use in not =
Alan
set COL.disp_browse = 'N'
where COL.user_no in (select u.user_no from user_account u where
u.expire_date = cast('NOW' as date));
use in not =
Alan
> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com]On Behalf Of vladman992000
> Sent: Thursday, 2 November 2006 1:33 AM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Basic SQL Update query question
>
>
> Forgive my naivety, but I have a statement like so:
>
> update collection COL
> set COL.disp_browse = 'N'
> where COL.user_no = (select u.user_no from user_account u where
> u.expire_date = cast('NOW' as date));
>
> When the Select part of the query returns multiple rows, it fails with
> a Multi Rows in Singleton result set.
>
> What is the best way to re-write this statement so that it updates all
> resulting items assuming the Select returns many records?
>
> Myles
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>