How to Delete using INNER JOIN with SQL Server? I want to delete using INNER JOIN in SQL Server 2008. But I get this error, Msg 156, Level 15, State 1, Line 15 ncorrect syntax near the keyword 'INNER'. My code: DELETE FROM WorkRecord2 INNER JOIN Employee ON EmployeeRun=EmployeeNo WHERE Company = '1' AND Date = '2013-05-06' Answer : You need to specify what table you are deleting from, here is a version with an alias: DELETE w
undefined
INNER JOIN ON vs WHERE clause For simplicity, assume all relevant fields are NOT NULL. You can do: SELECT table1.this, table2.that, table2.somethingelse FROM table1, table2 WHERE table1.foreignkey = table2.primarykey AND (some other conditions) Or else: SELECT table1.this, table2.that, table2.somethingelse FROM table1 INNER JOIN table2 ON table1.foreignkey = table2.primarykey WHERE (some other conditions) Do these two work on the same way in MySQL? Answer : INNER JOIN is ANSI syntax which you should use. It is generally considered more readable, especially when you join lots of tables.
undefined
What is the difference between “INNER JOIN” and “OUTER JOIN”? Also how do LEFT JOIN, RIGHT JOIN and FULL JOIN fit in? Answer : Assuming you're joining on columns with no duplicates, which is a very common case: An inner join of A and B gives the result of A intersect B, i.e. the inner part of a Venn diagram intersection. An outer join of A and B gives the results of A union B, i.e. the outer parts of a Venn diagram union. Examples Suppose you have two tables,