MySQL – Joining Tables without Join Keyword

Here is another micro post…

I used to use JOIN keyword whenever a table join was necessary in MySQL, but recently I have been using this other method of joining tables in MySQL (it should be applicable in MSSQL too). In this method you don’t need to say JOIN in your query.

Consider this example where you say “JOIN” to join 2 tables:

SELECT * FROM table1 INNER JOIN table2 ON;

You can join these tables without ever saying INNER JOIN or JOIN as below:

Select * from table1 t1, table2 t2 where =; //t1 and t2 are just aliases (shorthands) to refer to table1 and table2

Simple as that. Recently it just feels more natural to me 🙂

Hope this helps.
Use recyclable materials.

Leave a Reply

Your email address will not be published. Required fields are marked *

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /home/biginf5/public_html/wp-includes/wp-db.php on line 3215