这是查询,我有 3 个内部连接的表,现在我希望通过在我的管理员的 php 上执行查询来计算结果中的所有行,即 78,我不想要表的结果,我只想要 wchich 中的 1 行写的东西是 78,和我们在
SELECT count (*) FROM test_table
下面是3个内联表的查询
SELECT
mybb_users.uid,
mybb_users.username,
mybb_users.avatar,
mybb_posts.fid,
mybb_posts.uid,
mybb_posts.dateline,
mybb_posts.tid,
mybb_posts.subject,
mybb_forums.parentlist,
mybb_forums.fid
FROM mybb_forums
INNER JOIN mybb_posts ON mybb_forums.fid = mybb_posts.fid
INNER JOIN mybb_users ON mybb_posts.uid = mybb_users.uid
WHERE mybb_forums.parentlist LIKE '%58%'
GROUP BY mybb_posts.tid
ORDER BY mybb_posts.dateline DESC
现在如何计算其中的总行数?
已编辑
SELECT count( mybb_users.uid ) AS totalOfRows
FROM (
SELECT mybb_users.uid, mybb_users.username, mybb_users.avatar, mybb_posts.fid, mybb_posts.uid AS uidPost, mybb_posts.dateline, mybb_posts.tid, mybb_posts.subject, mybb_forums.parentlist, mybb_forums.fid AS fidForum
FROM mybb_forums
INNER JOIN mybb_posts ON mybb_forums.fid = mybb_posts.fid
INNER JOIN mybb_users ON mybb_posts.uid = mybb_users.uid
WHERE mybb_forums.parentlist LIKE '%58%'
GROUP BY mybb_posts.tid
)T
错误 ::#1054 -“字段列表”中的未知列“mybb_users.uid”