I'm trying to gain more knowledge concerning the MySQL database and I'm hoping someone over here might be able to explain to me the following issue as I cant find much about this particular behavior anywhere:
This works:
SELECT justaname FROM (SELECT productName AS justaname FROM kclbs_products) sdfsdfsd
While this doesnt:
SELECT justaname FROM (SELECT productName AS justaname FROM kclbs_products)
This really puzzle's me and I believe it to be a quirk because whatever I turn the string 'sdfsdfsd' into doesn't matter, the query still works, even when its just a single character (or a very large sequence of characters for that matter). This 'issue' doesn't represent a problem to me currently but I would really like to know the 'why' behind it to be able to deal with this kinda behavior anywhere in the possible future should I ever have to.
Thanks in advance.
[UPDATE] Two users have helped providing me with the answer to my question, so its solved, and thanks!