@IvenBach Depends on context. It's common to have same names for the same data point in multiple tables... e.g. my ProductID could be the primary key in Products table, but other tables will have a ProductID column as a foreign key referencing it
SELECT customer_name,
CASE WHEN age < 30 THEN 'Young'
WHEN age < 60 THEN 'Middle aged'
ELSE 'Senior Citizen'
END,
CASE WHEN postal_code < 50000 THEN 'Under9000'
ELSE 'Over9000'
END
FROM customer;
Without an AS to give it an alias both columns are case.
@IvenBach Oh. When you're using an expression as a column in a select clause, then if you don't give it an alias/name yourself then it doesn't have one
(in SSMS for example it will show as (No column name))
@Phrancis Except in MySQL... but that's another story...
@IvenBach Consider the query SELECT ProductID, ProductName, COUNT(Qty) AS "Units Sold" FROM Sales GROUP BY ProductID, ProductName then if you would remove ProductName from the GROUP BY section, which ProductName should it then return for each ProductID ? It might have multiple different product names and will not have any specification for how to choose just one.
> Playing against yourself has been disabled for quite a while, and the overall inner workings of how games work is now different so this issue is no longer an issue.
For example you have a view that pulls from a few tables, and now you want a new view that sums the total from that view but also pulls in all the columns. So before you had a * but now you need a group by
> This would be to incite your logged in players to try your different games and also to incite people into making accounts in the first place. I was just throwing it out there.
> Inciting people to make accounts would be nice, but honestly I don't care that much about which games they play... most of them were just created to push the limits of what the game engine could do :)