Mysql Inner Join with WHERE clause

Last Updated On Monday 1st Nov 2021

Inner Join with Where Clause

The INNER JOIN keyword selects records that have matching values in both tables.

INNER JOIN Syntax

	SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;
	

Note : The INNER JOIN keyword selects all rows from both tables as long as there is a match between the columns.

MySql Inner Join Where

The WHERE clause is used to filter records.It is used to extract only those records that fulfill a specified condition.

	SELECT column1, column2, ...
FROM table_name
WHERE condition;
	

Mysql inner Join Syntax.You can only use one WHERE clause in single query so try AND for multiple conditions like below

	 SELECT p.f_id  FROM wp_posts AS p
   INNER JOIN wp_terms AS t
     ON t.id = p.id
 WHERE t.name = 'InProcess'
   AND t.term_id = '430'
	

References