Hi Experts,
I have been trying to use inner join to execute delete function, however i have a error.
where did my SQL command goes wrong, please see below screenshot.
thanks in advance.
Hi,
Thanks for your input, however i ended up using this suggested syntax
Hello Ja
There is no screen shot attached, can you attach your screen shot and update it again.
check if you are using "output" in that sql query because output is mandatory.
Thanks
shehroze khan
Hi JA,
see here for delete query with join.
https://www.javatpoint.com/sql-delete-join
https://blog.sqlauthority.com/2013/05/03/sql-server-delete-from-select-statement-using-join-in-delete-statement-multiple-tables-in-delete-statement/
DELETE [target table]
FROM [table1]
INNER JOIN [table2]
ON [table1.[joining column] = [table2].[joining column]
WHERE [condition]
and use for output structure . delete query return nothing but its mendatory to add output.
Regards
Rahul Sahu
Rahul Sahu wrote:
Hi Rahul,
That i already tried that syntax but i encountered the same problem so i try to isolate using a single table deletion and it is working fine.
My problem is where when i used the inner join
see below screenshot
Hi Ja,
your statement is wrong . Please declare the table after the inner join statement you are joining with. Please see Rahul's comment
Table 2 is missing here
as per the screen shot it should be {ASHVoteMultipleChoice}
pranav pandey wrote:
Hi Pranav,
Thanks for pointing that i amend my SQL syntax but same error.
Ja wrote:
As i am seeing you "inner join" is not in blue color when you write sql.
i think problem is that.can you check inner join is working in your sql
USe below method once.
SyntaxEditor Code Snippet
DELETE {QuestionOptions} FROM {QuestionOptions},{Questions} WHERE {QuestionOptions}.[QuestionID] = {Questions}.[Id] and {QuestionOptions}.[QuestionID]=1
Look below query in OS
Hope this wil help you.