Can you use an alias in the WHERE clause in mysql?

前端 未结 5 1210
予麋鹿
予麋鹿 2020-11-22 04:11

I need to use an alias in the WHERE clause, but It keeps telling me that its an unknown column. Is there any way to get around this issue? I need to select records that have

5条回答
  •  一整个雨季
    2020-11-22 04:46

    SELECT * FROM (SELECT customer_Id AS 'custId', gender, age FROM customer
        WHERE  gender = 'F') AS c
    WHERE c.custId = 100;
    

提交回复
热议问题