in a query statement, an error often occurs:
SQL Foundation: ORA-00918: Error with column not explicitly defined.
There are two kinds of situations currently encountered. The reason is: when the query statement, the query table (dataset) has the same field name, the query field can not be confirmed that the field is changed
, errors that do not explicitly define the column are reported.
First case:
1. Single-table:
For example, there are three fields in a fconsign table: Fcsg_consign_id,fcsg_consign_type,fcsg_consign_status
Select fcsg_consign_id from (select fcsg_consign_id,fcsg_consign_type,fc.* from Fconsign FC) T
This SQL statement will get an error because the FCSG_CONSIGN_ID has two fields in T, causing the DBMS to not determine which column to query
Select Fcsg_consign_status from (select fcsg_consign_id,fcsg_consign_type,fc.* from Fconsign FC) T
This will not be an error, T fcsg_consign_status only one, so that will not be an error.
In Summary: In a nested query, the field of the outer query can only appear in a subquery, otherwise it is not possible to determine which field to check. Errors that do not explicitly define the column are reported.
2. Multi-table Joint query
For example, there is a field in table A and B.
Select a from a A, this will be an error. Because it's impossible to determine
Which column. Need to explicitly define A.A alive B.A (if the table is aliased after the from statement, such as select S_no,s_name,s_score,s.class_no,class_name from student S join Class C on (S.C Lass_no = c.class_no), the same field name that is owned by more than one table in the SELECT statement also needs to be identified with an alias such as:s.class_no.)
Oracle does not explicitly define columns