Unknown column issue with mysql alias

后端 未结 3 771
走了就别回头了
走了就别回头了 2021-01-12 06:03

I can\'t figure out why i am getting an unknown column when the column is an alias that was created. Any help would be great.

code:

SELECT DISTINCT 
         


        
3条回答
  •  情歌与酒
    2021-01-12 06:52

    You can use aliases in the order by clause, but you can't use aliases in the where or group by clause. Either you repeat the expression or you can use a subquery.

提交回复
热议问题