A WHERE clause is used to filter the rows returned from a SELECT statement, whereas an ON clause is used to specify the join criteria in a JOIN operation.  The WHERE clause is applied after the data has been retrieved from the database, whereas the ON clause is used to determine which rows are included in the join before the data is retrieved.  For example, in the following query:  SELECT * FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id WHERE t1.name = 'John'   The ON clause is used to specify that the rows from table1 and table2 should be joined on the id column, while the WHERE clause filters the results to only include rows where the name in table1 is 'John'. On the other hand, the ON clause can also include a condition to filter the rows that are included in the join, as in the following example: SELECT * FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id AND t2.status = 'active'   In this case, the ON clause is used to specify that the rows from table1 and table2 should be joined on the id column, and only rows where the status in table2 is 'active' will be included in the join.