When to use the IN operator in your SQL WHERE statement

Finding your SQL statements growing and difficult to understand? Inherited some code that contains complex looking SQL statements? Let me show you one way to make them easier to read and understand… Sooner or later you will have to create a SQL statement with multiple WHERE conditions, usually AND and OR’s. If you have three […]

How to INNER JOIN on the same table twice in SQL statement

Having more than one INNER JOIN to the same table can be confusing. More than one INNER JOIN can create a messy SQL statement. If you don’t use aliases they can become difficult to read. So join them with aliases, as explained below. For example say you have the following two tables: Users and Products. […]

How to join the same table twice in a single SQL query statement?

Having more than one join to the same table can be confusing. You might not have even thought it was possible to have multiple joins to the same table. It is possible and easy to do with the help of aliases. Aliases for table names Aliases allow you to reference the table name with an […]