MySql alias same as column name

Toniq :

Is this a bad practice having alias same as column name? It seems to work but I wonder will it lead to problems ?

SELECT SUM(foo) AS foo FROM {$table}
drakin8564 :

It shouldn't cause any problems. That said it would probably read better(more easily understandable) if you name it something like totalfoo or sum_of_foo.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=170908&siteId=1