MySQL 是不支持这种骚操作的
比如
SELECT
left(A.PURC_MAT_KIND_CODE,2) as "zs",
A.*
FROM
wlplat.V_MATERIAL_CODE_STOCKPILE A
WHERE
A.MAT_STATUS = '2'
and zs in ("50","52")
哪我就是想用怎么办,那就用套娃来实现嘿嘿
SELECT
*
FROM
( SELECT LEFT ( A.PURC_MAT_KIND_CODE, 2 ) AS "zs", A.* FROM wlplat.V_MATERIAL_CODE_STOCKPILE A ) A
WHERE
A.MAT_STATUS = '2'
AND A.zs IN ( "50", "52" )