Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: delete only 1 row
A common trick is
delete from my_table x
where x.rowid = (select min(y.rowid)
from my_table y where y.my_col = x.my_col)and x.my_col = 3.
However, you should be aware every table should have a primary (and also unique) key, so you don't need to resort to this trick.
Hth,
Sybrand Bakker, Oracle DBA
EN <nlee_at_mediashell.net> schreef in berichtnieuws
3934217A.F2FEA841_at_mediashell.net...
> Hi,
>
> This is a newbie question ...
>
> For example, I'm executing the SQL statement below:
>
> DELETE FROM my_table WHERE my_col = 3
>
> My understanding is that every row with "my_col = 3" will be deleted.
> What if I only want one of those rows to be deleted?
>
>
> Any help is greatly appreciated,
> EN
Received on Tue May 30 2000 - 00:00:00 CDT