Compared with oracle, if the subquery involved, the corresponding table name and field must be named with an alias before execution. There are two main scenarios: 1. in the query SQL statement, only simple subqueries do not contain grouping and summation Wait For example: elect * from (selectcom_idfromcompany). In this case, an error is reported. The outer layer must be added with an alias.
Compared with oracle, if the subquery involved, the corresponding table name and field must be named with an alias before execution. There are two main scenarios: 1. in the query SQL, only simple subqueries that do not contain grouping and summation Wait For example: elect * from (select com_id from company) will report an error. The outer layer must be added with an alias.
Compared with oracle, if the subquery involved, the corresponding table name and field must be named with an alias before execution. There are two main scenarios:
1. in the query SQL statement, only simple subqueries that do not contain grouping and summation Wait For example: elect * from (select com_id from company) will report an error. An alias must be added to the outer layer ,, select * from company in the lower layer can be added with an alias or incorrect: select * from (select com_id from company)
2. when the queried SQL contains grouping, summation, and other functions, for example: select * from (select com_id, count (com_id) from company group by com_id) a: If an alias is added to the outermost SQL, an error is returned. The alias B select * from (select com_id, count (com_id) from company B group by com_id) is added to company) a does not work either. In fact, the count () function can also be used as a subquery. Therefore, you must add an alias to count (): select * from (select com_id, count (com_id) c from company B group by com_id)