I stumbled across an interesting (to me) query, and I’m not really sure what it does.
SELECT SQL_CALC_FOUND_ROWS DISTINCT P.* FROM table P WHERE P.status = ...
The question is in regard to the P specifically FROM table P. I know in the FROM clause you can use an AS clause, but this particular query doesn’t. Is the word AS optional?
Definining aliases isn’t always optional, but when you do define an alias the keyword
ASis always optional.Source: JOIN Syntax
The
ASkeyword is also optional when defining column aliases:Source: SELECT Syntax