mysql语法有关问题

WBOY
Release: 2016-06-13 12:19:13
Original
1153 people have browsed it

mysql语法问题

<br />SELECT (`aaa`/`bbb`) AS ccc<br />FROM test<br />WHERE ccc > 1<br />
Copy after login

搜寻是没问题,但是加上WHERE条件会说[Err] 1054 - Unknown column 'ccc' in 'where clause',请问要怎么修正?
------解决思路----------------------
SELECT (`aaa`/`bbb`) AS ccc<br />FROM test<br />WHERE `aaa`/`bbb` > 1<br />
Copy after login

SELECT (`aaa`/`bbb`) AS ccc<br />FROM test<br />HAVING ccc > 1
Copy after login


注意:`aaa`/`bbb` 不会被重复计算

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template