有没有办法使用 WHERE 或其他方式返回“AS”结果?
我正在对 FONE1 列执行 SUBSTRING 并尝试返回 DDD = 31 但我收到错误代码:1054。“where 子句”中的未知列“DDD”0.000 秒
-->
SELECT **SUBSTRING(FONE1,1,2) AS DDD**, FONE1, F1STA,LASTCALL
FROM discador_processados
WHERE fila_mailing = 2638
AND F1STA ='ANSWER'
AND CLASSE1 IN ('VC2','VC3')
**AND DDD = 31**
AND LASTCALL BETWEEN '2020-10-02 00:00:00' AND '2020-10-30 23:59:59'
这个想法是得到下面的回报
DDD FONE1 F1STA LASTCALL
31 31999999999 ANSWER 2020-10-02 09:08:13
31 31999999999 ANSWER 2020-10-02 09:09:16
31 31999999999 ANSWER 2020-10-02 09:17:41
谢谢!