浏览了类似标题的问题,没有任何内容足够接近这个查询。我知道这可能是很简单的事情。
实际的查询是:

select entries.id, entry_id, user_id, person_id, campaign_id, mood_id, entries.created, deleted_date, entries.modified, entry_type, walking_hash

 from entries, users

where users.id = entries.user_id and users.is_deleted = 0 and entries.is_deleted = 0

and entries.entry_type in ('xyz', 'abc', 'def', 'lmno')

为了数数我试过这个:
select count(entries.id, entry_id, user_id, person_id, campaign_id, mood_id, entries.created, deleted_date, entries.modified, entry_type, walking_hash)

from entries, users

where users.id = entries.user_id and users.is_deleted = 0 and entries.is_deleted = 0 and entries.entry_type in ('xyz', 'abc', 'def', 'lmno')

但这会抛出一个无法描述的错误,并且不会运行。

最佳答案

你应该用简单的

Select count(entries.id)  ....

关于mysql - 需要获得对MySQL连接查询的计数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7206310/

10-15 23:27