Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP!
Try:
SQL>select * from t;
COL
4 rows selected.
SQL> delete from t a where exists
2 (select null from t b where length(a.col)=7 and b.col like a.col||'_');
2 rows deleted.
SQL>select * from t;
COL
2 rows selected.
Michael a écrit dans le message
>I am trying to select the first seven char of 8 characters column
>within a large table & then compare this with existing seven char columns.
>If there is a match then I need to delete the seven chars.
>
>eg.
>
>Table X
>
>House_ no
>A1093459
>A109345 >needs to be deleted
>B2062768
>B206276 >needs to be deleted
>
>
>I have tried
>
>DELETE FROM (SELECT * FROM X
>WHERE HERD_NO LIKE SUBSTR(HOUSE_NO,1,7)||'_')
>
>but this deletes 8 characters
>
>
>
>
>
>
Received on Mon Aug 30 1999 - 04:11:09 CDT