Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi all.

I wanna to delete the table records that has inner join to another table

SQL
DELETE  DISTINCTROW

FROM  ((Ghesting INNER JOIN
        buyer ON Ghesting.fk_code_m_buyer = buyer.code_m_buyer) INNER JOIN
        kala ON buyer.code_m_buyer = kala.buyer_codem
WHERE(fk_code_m_buyer= ?) AND (kala.type_kala= ?) AND ( kala.model_kala=?)


Indeed I want to delete "Ghesting" record table with condition(WHERE) (kala.type_kala= ?) AND ( kala.model_kala=?) but shows have syntax error.

How to use inner join statement in delete query ?
thanks a lot.
Posted
Updated 21-Mar-15 6:12am
v6
Comments
jgakenhe 21-Mar-15 12:22pm    
//Try this, it'll work in SQL Server, but unsure about Access
DELETE Ghesting
FROM Ghesting
INNER JOIN buyer
ON Ghesting.fk_code_m_buyer = buyer.code_m_buyer
INNER JOIN kala
ON buyer.code_m_buyer = kala.buyer_codem
WHERE(fk_code_m_buyer= ?)
AND (kala.type_kala= ?)
AND ( kala.model_kala=?)
bernova 22-Mar-15 5:04am    
My problem don't solved
bernova 22-Mar-15 5:16am    
DELETE Ghesting
FROM ((kala INNER JOIN buyer ON kala.buyer_codem = buyer.code_m_buyer) INNER JOIN Ghesting ON buyer.code_m_buyer = Ghesting.fk_code_m_buyer)
WHERE(Ghesting.fk_code_m_buyer= ?)

shows error " no given value for one or many parameter "

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900