SELECT (`aaa`/`bbb`) AS cccFROM testWHERE ccc > 1
Salin selepas log masuk
搜寻是没问题,但是加上WHERE条件会说[Err] 1054 - Unknown column 'ccc' in 'where clause',请问要怎么修正?
回复讨论(解决方案)
SELECT (`aaa`/`bbb`) AS cccFROM testWHERE `aaa`/`bbb` > 1
Salin selepas log masuk
或
SELECT (`aaa`/`bbb`) AS cccFROM testHAVING ccc > 1
Salin selepas log masuk
注意:`aaa`/`bbb` 不会被重复计算