Subject | Re: [firebird-support] Does Firebird support deletes, updates with subquery? |
---|---|
Author | Helen Borrie |
Post date | 2005-02-19T06:17:41Z |
At 07:35 PM 18/02/2005 +0000, you wrote:
WHERE EXISTS
(SELECT 1 FROM INGREDIENTS
WHERE I.R_ID = R.R_ID
AND I.NAME='RICE')
And, yes, you can use a subquery in either the SET value or the search
value of an update query. I can't offer a sensible example from your
current example, though. Give some detail about what you'd want to do in
such an update.
./heLen
>Does Firebird support deletes and/or updates with subquery?.DELETE FROM RECIPES R
>Something like this:
>
>DELETE FROM RECIPES
>WHERE R_ID = ( SELECT R_ID FROM INGREDIENTS
> WHERE NAME='RICE' )
WHERE EXISTS
(SELECT 1 FROM INGREDIENTS
WHERE I.R_ID = R.R_ID
AND I.NAME='RICE')
And, yes, you can use a subquery in either the SET value or the search
value of an update query. I can't offer a sensible example from your
current example, though. Give some detail about what you'd want to do in
such an update.
./heLen