Questions tagged «mysql-error-1111»

6
SQL分组依据和排序依据
我有一张标签表,想从列表中获得计数最高的标签。 样本数据如下所示 id (1) tag ('night') id (2) tag ('awesome') id (3) tag ('night') 使用 SELECT COUNT(*), `Tag` from `images-tags` GROUP BY `Tag` 让我得到正在寻找的完美数据。但是,我希望对它进行组织,以使最高的标签数排在首位,并限制它仅向我发送前20个左右。 我试过了 SELECT COUNT(id), `Tag` from `images-tags` GROUP BY `Tag` ORDER BY COUNT(id) DESC LIMIT 20 而且我不断收到“组功能的无效使用-ErrNr 1111” 我究竟做错了什么? 我正在使用MySQL 4.1.25-Debian

2
MySQL:无效使用组函数
我正在使用MySQL。这是我的架构: 供应商(sid:整数,sname:字符串,地址字符串) 零件(pid:整数,pname:字符串,color:字符串) 目录(sid:整数,pid:整数,成本:实数) (主键以粗体显示) 我正在尝试编写查询以选择至少两个供应商制造的所有零件: -- Find the pids of parts supplied by at least two different suppliers. SELECT c1.pid -- select the pid FROM Catalog AS c1 -- from the Catalog table WHERE c1.pid IN ( -- where that pid is in the set: SELECT c2.pid -- of …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.