0

Find the error in this query

I have a table called table1 contains id column values like 1 to 10, another table table2 contain iid column values like 5 to 15 now my query is delete from table1 where id in(select id from table2)

18th Jul 2016, 5:11 PM
ashwath nm
ashwath nm - avatar
3 Answers
0
if u found error plz share the result of this query
18th Jul 2016, 5:12 PM
ashwath nm
ashwath nm - avatar
0
above query is correct. alternatively you can also try joins if you want DELETE ID FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID
18th Jul 2016, 5:40 PM
Omkar
0
hello omkar there is an error in the query and thanks for the answer ok i will tell the error table2 doesn't have id column table2 has iid column, but when you run this query in sql server you can't get the error because sql ignores sub query error and executes the query successfully but result is table1 rows will Delete entirely not from rows id 5 to 10
19th Jul 2016, 3:07 AM
ashwath nm
ashwath nm - avatar