I'm trying to delete data's from one table with join condition.
I tried this
Delete test_one from test_one Val
join test_two En
on Val.Map_Fromphyid=En.Fromphyid And
Val.Map_Tophyid=En.Tophyid And
Val.Map_Relname=En.Relname
Where Val.Result='NOT Done'
But this is giving me this error
"SQL command not properly ended"
I know i can do that by this way
Delete From test_one
Where Phyid In (Select Val.Phyid From test_one Val
join test_two En
on Val.Map_Fromphyid=En.Fromphyid And
Val.Map_Tophyid=En.Tophyid And
Val.Map_Relname=En.Relname
Where Val.Result='NOT Done');
What is the problem with first method? if it is wrong how to acheive that thing without subquery?
I have seen this question . I am looking for query without any subquery in it. I found the answers only with subquery.