explicit and implicit inner joins

http://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins

  • Performance wise, they are exactly the same
  • the join syntax makes it clearer that the tables are joined and how they are joined

INNER JOIN: return rows when there is at least one match in both tables

LEFT JOIN: return ows from the left table, even there is no match in the right table

FULL JOIN: return rows where there is a match in one of the tables

SQL HAVING Syntax

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name conditions
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
=================================

http://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins

  • Performance wise, they are exactly the same
  • the join syntax makes it clearer that the tables are joined and how they are joined

INNER JOIN: return rows when there is at least one match in both tables

LEFT JOIN: return ows from the left table, even there is no match in the right table

FULL JOIN: return rows where there is a match in one of the tables

SQL HAVING Syntax

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name conditions
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
=================================

http://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins

  • Performance wise, they are exactly the same
  • the join syntax makes it clearer that the tables are joined and how they are joined

INNER JOIN: return rows when there is at least one match in both tables

LEFT JOIN: return ows from the left table, even there is no match in the right table

FULL JOIN: return rows where there is a match in one of the tables

SQL HAVING Syntax

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name conditions
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
=================================
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s