Every derived table (AKA sub-query) must indeed have an alias. I.e. each query in brackets must be given an alias (AS whatever
), which can the be used to refer to it in the rest of the outer query.
SELECT ID FROM ( SELECT ID, msisdn FROM ( SELECT * FROM TT2 ) AS T ) AS T
In your case, of course, the entire query could be replaced with:
SELECT ID FROM TT2
Related Posts:
- MySQL Error 1093 – Can’t specify target table for update in FROM clause
- MySQL Error 1093 – Can’t specify target table for update in FROM clause
- Join vs. sub-query
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- 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
- 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’
- What’s the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? [duplicate]
- 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?
- 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
- Which MySQL data type to use for storing boolean values
- How can I do a FULL OUTER JOIN in MySQL?
- Nested select statement in SQL Server
- 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)
- 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
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- 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’
- 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
- mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
- Not unique table/alias
- Invalid column count in CSV input on line 1 Error
- How do I import an SQL file using the command line in MySQL?
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- #1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’
- MySQL ERROR 1045 (28000): Access denied for user ‘bill’@’localhost’ (using password: YES)
- How to set a timer in mysql
- Your password does not satisfy the current policy requirements
- ERROR 1064 (42000) in MySQL
- How to split the name string in mysql?