SELECT Y/X as Z
FROM (
SELECT
(count(county) FROM `cleanup_site_list_2011` WHERE county= kings ) as X,
(count(county) FROM `cleanup_site_list_2011` WHERE county= kings AND people != 0) as Y
FROM `cleanup_site_list_2011`
) as innertable
在上述例子中,两个“SlectT ......”表示对任何描述的 queries问(X和Y将是分类)。 当我试图使用这一说法时,我发现错误。
#1054 - Unknown column Y in field list
我怎么能让我的SQL认识到我设立的栏目的名称? 而且,一旦数学开始,我如何使分部分产生浮动? 还是自动这样做?