COUNT(*) returning multiple rows instead of just one

后端 未结 4 1703
春和景丽
春和景丽 2020-12-16 23:19

Why does COUNT() return multiple rows when I just need the total count of how many rows my query generates?

Should return 1078.

4条回答
  •  离开以前
    2020-12-16 23:54

    Write the above query as subquery then it will give proper result and dont use group by

    select count(*) from (select articles.id from 'contract_prices' left join 'articles' on
        (arcticles.id = contract_prices.article) 
        where 'contract_to' >= curdate()
        )
    

提交回复
热议问题