Delete with inner join syntaxe

Database

Delete with inner join syntaxe

Hello,

I executed this query:

------------------------------------------
delete
from ATL_TMP.ANN_W_IMPORT_ERR A
inner join ATL_TMP.ANN_T_IMPORT_ERR B
on A.NOM_FIC=B.NOM_FIC
------------------------------------------

in Teradate SQL Assistant

and it watch me this error:
"Joined table are not allowed in from clause"

what's wrong in this query?

Thanks for your help,
4 REPLIES
Enthusiast

Re: Delete with inner join syntaxe

Hi

Your query will try to delete the records on the derived table(A inner join B) and the delete statement cannot be used like that...

Try the following query:

delete from ATL_TMP.ANN_W_IMPORT_ERR
where NOM_FIC in (Select NOM_FIC from ATL_TMP.ANN_T_IMPORT_ERR)

Regards,
Balamurugan

Re: Delete with inner join syntaxe

But this syntax runs without error:

----------------------------
delete
from ATL_TMP.ANN_T_IMPORT_ERR B
, ATL_TMP.ANN_W_IMPORT_ERR A
where A.NOM_FIC=B.NOM_FIC
---------------------------------

In this case, why "inner join" didn't work
ST
New Member

Re: Delete with inner join syntaxe

I had the same question. Insight would be appreciated.

Senior Apprentice

Re: Delete with inner join syntaxe

Well, as the error message implies, the JOIN-syntax was never implemented, maybe because no Outer Join is allowed.