Discussion Overview
The discussion revolves around the use of aliases and old names in MySQL queries, specifically focusing on whether aliases created with the AS keyword can be used outside the query and if old names can still be referenced. The scope includes technical explanations and practical applications of SQL syntax.
Discussion Character
- Technical explanation, Debate/contested
Main Points Raised
- Some participants assert that aliases created with the AS keyword in MySQL are not stored by the database and cannot be used outside the query.
- One participant questions whether the old name can still be used after renaming, suggesting that it may not be possible based on their experience.
- A participant provides examples illustrating that while using an alias works in certain contexts, referencing the old name in conjunction with the alias does not work, leading to an "Unknown column" error.
- Another participant suggests that if there is a need for external or global aliases, creating a view could be a solution.
Areas of Agreement / Disagreement
Participants generally agree that aliases are not retained outside of the query context, but there is uncertainty regarding the use of old names after renaming. The discussion remains unresolved on whether old names can be referenced in all scenarios.
Contextual Notes
Limitations include potential misunderstandings of SQL behavior regarding aliases and old names, as well as the specific contexts in which certain queries may or may not work.