You are joining the same table 2 times and hence you need to provide the unique alias name. However looks like you are looking for parts
table and hence need to join that table
SELECT categories.name, categories.sub_name, parts.name FROM categories INNER JOIN presentations ON categories.id=presentations.category INNER JOIN parts ON parts.id=presentations.parts WHERE presentations.id=5;
For better readability you can always give some short alias name something as
select c.name, c.sub_name, p.name as parts_name from categories c join presentations pr on pr.category = c.id join parts p on p.id = pr.parts where pr.id = 5
Related Posts:
- What’s the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? [duplicate]
- How can I do a FULL OUTER JOIN in MySQL?
- MySQL Multiple Joins in one query?
- 1052: Column ‘id’ in field list is ambiguous
- 1052: Column ‘id’ in field list is ambiguous
- SQL version of VLOOKUP
- Join vs. sub-query
- select * from table where column = something or, when unavailable, column = something else
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- What is the difference between “INNER JOIN” and “OUTER JOIN”?
- What is the difference between “INNER JOIN” and “OUTER JOIN”?
- How to use mysqli_query() in PHP?
- Access Denied for User ‘root’@’localhost’ (using password: YES) – No Privileges?
- Unknown column in ‘field list’ error on MySQL Update query
- Unknown column in ‘field list’ error on MySQL Update query
- How to log in to phpMyAdmin with WAMP, what is the username and password?
- Access Denied for User ‘root’@’localhost’ (using password: YES) – No Privileges?
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- Column count doesn’t match value count at row 1
- SQL Inner-join with 3 tables?
- Undefined function mysql_connect()
- A JNI error has occurred, please check your installation and try again in Eclipse x86 Windows 8.1
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- MySQL column count doesn’t match value count at row 1 [closed]
- MySQL string replace
- Cannot add or update a child row: a foreign key constraint fails
- Undefined function mysql_connect()
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- Fatal error: Call to undefined function mysql_connect()
- String concatenation in MySQL
- Should I use mysqli_real_escape string() or mysql_real_escape_string() for form data?
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- MySQL – Operand should contain 1 column(s)
- Can’t connect to MySQL server on ‘localhost’ (10061) after Installation
- MySQL “CREATE TABLE IF NOT EXISTS” -> Error 1050
- Cannot add or update a child row: a foreign key constraint fails
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL Error “Operand should contain 1 column”
- MySQL create table if not exists and insert record only if table was created
- Rename a table in MySQL
- Can’t connect to MySQL server on ‘localhost’ (10061) after Installation
- getting error HTTP Status 405 – HTTP method GET is not supported by this URL but not used `get` ever?
- How to use MySQL DECIMAL?
- Access denied for user ‘root@localhost’ (using password:NO)
- How should I tackle –secure-file-priv in MySQL?
- How do I use MySQL through XAMPP?
- Join/Where with LINQ and Lambda
- Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (38)
- How to make MySQL table primary key auto increment with some prefix
- Access denied for user ‘root@localhost’ (using password:NO)
- MySQL ERROR 1290 (HY000) –secure-file-priv option
- How do I use properly CASE..WHEN in MySQL
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- Fatal error: Call to undefined function mysql_connect()
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- MySQL error 2006: mysql server has gone away
- Count unique values per groups with Pandas
- Which MySQL data type to use for storing boolean values
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- sql query with multiple where statements
- Fatal error: Call to undefined function mysql_connect()
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- Remove duplicate values from JS array [duplicate]
- MySQL query String contains
- ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
- What’s the difference between VARCHAR and CHAR?
- Cannot delete or update a parent row: a foreign key constraint fails
- Cannot delete or update a parent row: a foreign key constraint fails
- What is the error “Every derived table must have its own alias” in MySQL?
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- Remove duplicate values from JS array
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- Case statement in MySQL
- http://localhost:80 is not working on running Apache server through UniServer ZeroXIII
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- MySQL server startup error ‘The server quit without updating PID file’
- pandas: merge (join) two data frames on multiple columns
- Rename a column in MySQL
- Configuration System Failed to Initialize
- How to declare a variable in MySQL?
- Can’t find mysqladmin on Mac OSX 10.6.8
- Mysql query- How to use contains?
- “INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”
- Cannot delete or update a parent row: a foreign key constraint fails
- Export Pervasive to MySQL (C#)
- MySQL Every derived table must have its own alias
- MySQL Cannot Add Foreign Key Constraint
- A JNI error has occurred, please check your installation and try again in Eclipse x86 Windows 8.1
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- MySQL server startup error ‘The server quit without updating PID file’
- How do I restore a dump file from mysqldump?
- Syntax error due to using a reserved word as a table or column name in MySQL
- ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
- MySQL root password change
- Deprecated: mysql_connect()
- Installation of MySQL for Visual Studio 1.2.8 failed