Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All
I wanna use the DISTINCTROW to delete in sql But have syntax error near Ghesting
Query :
SQL
DELETE DISTINCTROW FROM  Ghesting  ((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 ([buyer.code_m_buyer] =@code_m_buyer) AND ([Ghesting.ser_kala]=@ser_kala) AND ([Ghesting.status_pay]= @status_pay)


How do I solve it ?

What I have tried:

I delete the DISTINCTROW Command in SQL Syntax but i have same error.
Posted
Updated 20-May-16 19:48pm

Try:
SQL
DELETE DISTINCTROW FROM Ghesting kala 
INNER JOIN buyer ON kala.buyer_codem = buyer.code_m_buyer
INNER JOIN Ghesting xxx ON buyer.code_m_buyer = xxx.fk_code_m_buyer
WHERE buyer.code_m_buyer = @code_m_buyer AND 
      xxx.ser_kala = kala.@ser_kala AND
      xxx.status_pay = kala.@status_pay
But backup your DB FIRST as I have no idea of how your tables are organised or what data you want to delete and what you want to keep!
 
Share this answer
 
Comments
bernova 21-May-16 2:06am    
thanks a lot , I just know syntax of the DISTINCTROW command in Sql
select DISTINCTROW e.*
FROM amp AS e inner JOIN m ON (e.sn= m.sn) AND (e.pn= m.pn)
 
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