按列名分组 -> 该列中的特定值
Group by column name -> specific value in that column
我被困在这个查询中...
SELECT SUM(points) AS total FROM `library` AS lib JOIN subitem_lib AS subitem on lib.id = subitem.lid JOIN items AS item on subitem.iid = item.id group by item.pid
是否可以从 item.pid 中获取特定字段值?
此列可以有不同的值 (1 -> 9999999...)
我用 php 渲染了这个页面,它给了我一个项目 ID (pid)。现在,我的计数应该得到该项目的特定分数。
非常感谢任何帮助。
您需要在查询中添加 where 条件以将结果限制为特定
我被困在这个查询中...
SELECT SUM(points) AS total FROM `library` AS lib JOIN subitem_lib AS subitem on lib.id = subitem.lid JOIN items AS item on subitem.iid = item.id group by item.pid
是否可以从 item.pid 中获取特定字段值? 此列可以有不同的值 (1 -> 9999999...)
我用 php 渲染了这个页面,它给了我一个项目 ID (pid)。现在,我的计数应该得到该项目的特定分数。
非常感谢任何帮助。
您需要在查询中添加 where 条件以将结果限制为特定