Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query Clarification.
On Thu, 27 Oct 2005 18:58:26 -0700, Scott wrote:
> I want to update the ColStatusB of Table B, only if the IDs in both
> table matches and the colCheckC of TableC is of a particular type, say
> 'Out of Stock'. I have written this query and it does not seem to work.
>
> UPDATE TABLEB SET ColStatusB = 'Updated' WHERE ColIDB = '' AND EXISTS
> SELECT colCheckC FROM TABLEC WHERE ColIDC = '' AND colCheckC NOT IN
> ('',''))
>
> These are the Table Structures of 2 tables,
>
Scotty, you shouldn't use comparison with '', you should compare with the NULL value, is "colidc is null" and "colcheckc is not null". Of course, such comparisons cannot use normal B-tree indexes. It's all in the manuals, which are on http://tahiti.oracle.com. If it is hard for you to read manuals, there is a great list where your questions can get answered. Look into the thread named "Beginners list" for details.
-- http://www.mgogala.comReceived on Sat Oct 29 2005 - 00:20:47 CDT
![]() |
![]() |