Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
Background: the error of every derived table must have its own alias occurs during the query of linked tables
Error code:
SELECT t1.id FROM zhfw_service_reply t1
JOIN(
SELECT id FROM zhfw_service_theme t3 WHERE
updated_time < #{time}
AND section_code = 'service'
) on t3.id = t1.theme_id
Cause: the alias of the table was omitted. Query to generate new tables every derived table must have its own alias . That is, the result of the join needs a new name. Replace with the following:
SELECT t1.id FROM zhfw_service_reply t1
JOIN(
SELECT id FROM zhfw_service_theme WHERE
updated_time < #{time}
AND section_code = 'service'
)t3 on t3.id = t1.theme_id
Note the location of T3
Similar Posts:
- [Solved] MYSQL Error: “ Every derived table must have its own alias”
- How to Solve MYSQL Error: Every derived table must have its own alias
- SQL Error: Table is specified twice, both as a target for ‘UPDATE’ and as a separate source for data
- How to Delete using INNER JOIN with SQL Server?
- Using join buffer (Block Nested Loop)
- ERROR 1104 (42000): The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
- sql Error: Every derived table must have its own alias [How to Solve]
- MySQL error message: subquery returns more than 1 row and its solution
- Using multiple tables_ Hash hint, are you right?
- [Solved] Mybatis multi-table query error: Column ‘id’ in field list is ambiguous