Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [Help]Select Distinct problem from VB
"Tim Trimble" <ttrimble_at_fda.net> wrote (in
<893442467.476839_at_wagasa.cts.com>)...
[snip]
|
| Here's the SQL statement:
| UPDATE MYTABLE SET MYFIELD =
| (SELECT DISTINCT OTHFIELD FROM TABLE2
| WHERE FIELD3 = 'myval')
| WHERE MYFIELD2 = 'myotherval'
|
| Any ideas?
Hello,
Ensure that the subquery can only return *one* row. If it returns
more than one row then the database engine is going to get confused
trying to update one row with more than one value in the same column.
Try using the max or min function.
On a separate point, the 'distinct' clause is redundant in a subquery.
It only returns distinct values anyway.
graham Received on Sat Apr 25 1998 - 02:35:52 CDT
![]() |
![]() |