0

我正在尝试运行查询,但出现“'where 子句'中的未知列'MyField'”错误。

这是我的查询:

SELECT id, sum(lineValue * quantity) as TotalLine
FROM myTable
WHERE (TotalLine BETWEEN 10 and 500)
group by id 

如何执行类似的查询?谢谢

4

1 回答 1

7
SELECT  id, SUM(lineValue * quantity) as TotalLine
FROM    myTable
GROUP BY
        id
HAVING  TotalLine BETWEEN 10 and 500
于 2009-04-13T10:45:16.357 回答