How to use alias in where clause in mysql

后端 未结 4 1744
不思量自难忘°
不思量自难忘° 2021-01-13 04:16

Are there any other way of doing this query:

SELECT CONCAT_WS(\" \", strLname, strFname, strMname) AS lessor_name 
FROM tbl_lessor 
WHERE lessor = \'$less         


        
4条回答
  •  太阳男子
    2021-01-13 04:41

    This will work.

    SELECT * FROM (SELECT CONCAT_WS(" ", strLname, strFname, strMname) AS lessor_name 
    FROM tbl_lessor) AS t1 
    WHERE lessor_name = '$lessor_name'
    

提交回复
热议问题