Top 'n' Row

MSSQL

MySQL

Double quotation marks table creation

MSSQL supported for with and without double quotation (“”) marks table creation.

MSSQL

MySQL

Comments

Although multi-line comments used the same comment style, the single-line comment style is different.

MSSQL

Single-line comment

multiple-line comment

MySQL

Single-line comment

multiple-line comment

Natural Join

MSSQL

MSSQL does not support Natural Join.

MySQL

USING Clause

MSSQL

MSSQL Server doesn't support USING clause.

Same results can be achieved using AND and JOIN clause in MSSQL.

MySQL

FULL OUTER JOIN

MSSQL is supporting the FULL OUTER JOIN, but MySQL does not.

MSSQL

MySQL

Use of the WHERE clause to join tables

MSSQL

Same results can be achieved using ON and JOIN clause in MSSQL.

MySQL

Code can be used in both MSSQL and MySQL

LIKE

NOT LIKE

EXISTS

GROUP BY, ORDER BY

HAVING

CROSS JOIN

CROSS JOIN will return all the results that associate every row in the first table with every row in the second table.

EQUI-JOIN

The name Equi-join comes from the equality condition in the where clause.

NATURAL JOIN

MSSQL does not support Natural Join.

Below query will produce the same results in both MSSQL and MySQL. (Alternative to the NATURAL JOIN).

Condition Join

The Inner Join

In the Inner join, when join condition is satisfied a row is added to the result set. The Cross join, Equi-join, Natural join and condition join are example of Inner join.

The Outer Join

There are three different kinds of outer join. The left outer join, the right outer join and the full outer join.

The left outer join, accept all the results of the Inner join and it also accepts rows from the table on the left that do not satisfy the join condition.

The right outer join, accept all the results of the Inner join and it also accepts rows from the table on the right that do not satisfy the join condition.

The full outer join, accept all the results of the Inner join and it also accepts rows from both the table on the left and the table on the right that do not satisfy the join condition. MySQL does not support the full outer join. You can use UNION instead of FULL OUTER JOIN. (both MySQL and MSSQL support UNIO).

Self Join

The self join is a join of one instance of a table to a second instance of the same table.