. Advertisement .
..3..
. Advertisement .
..4..
How to solve the problem – every derived table must have its own alias? I have the sample detail:
SELECT ID FROM (
SELECT ID, msisdn
FROM (
SELECT * FROM TT2
)
);
While I was running it, I found the warning message:
Every derived table must have its own alias.
That is my question in my midterm exam, and it is urgent. I searched the solutions on some websites, but I didn’t get it. I may miss any line or other changes. I appreciate your assistance!
The cause: This issue is caused by the reason that you make a new table using your subquery for the
FROM
Command.If you don’t use the keyword
AS
to identify the alias for those queries, the DBMS query engine won’t be able to tell which query is which without knowing their names (or aliases).Solution:
The requirement is that every derived table (AKA sub-query) needs to have an alias and each query in brackets must be having an alias that can be used to refer to it in the remainder of the outer query.
You can replace the entire query with:
It’s asking you this:
Why would you ask this question?