MySQL reports an error when executing multi-table query: [SQL] SELECT * from ( select e.account from employee e UNION SELECT u.account from `user` u UNION SELECT a.account from agent a ) [Err] 1248 - Every derived table must have its own alias This means that each derived table must have its own alias. This error usually occurs when querying multiple tables or subqueries. In a nested query, the result of the subquery is used as a derived table for querying the upper level, so the result of the subquery must have an alias. In the above example, modify the query statement: SELECT * from ( select e.account from employee e UNION SELECT u.account from `user` u UNION SELECT a.account from agent a )as total As shown above, adding a sentence as total after the subquery is equivalent to giving the derived table of the subquery result set an alias of total, and the problem is solved. You may also be interested in:
|
<<: js date and time formatting method example
>>: Solve the problem of Linux FTP anonymous upload and download starting automatically
Today, when I was looking at the laboratory proje...
This is an article written a long time ago. Now it...
I am using the Ubuntu 16.04 system here. Installa...
Today, I will record how to install MySQL 8.0.18 ...
In this blog, I will walk you through the process...
1. Apache static resource cross-domain access Fin...
If you don't want to use javascript control, t...
Table of contents Preface 1. What are Mixins? 2. ...
Why doesn't your height:100% work? This knowl...
1. Install MySQL # Download mysql in docker docke...
Beginners can learn HTML by understanding some HT...
Table of contents The first method: When the MySQ...
Preface mysqlslap is a diagnostic program designe...
Table of contents Preface text 1. Install styleli...
The enctype attribute of the FORM element specifie...