Hi,
Can we use count inside case statement.
Need suggestions..

Error: ER_INVALID_GROUP_FUNC_USE: Invalid use of group function

select COUNT(case when count(c3.id)>1 then c3.id end) as more_then_one
......................
...........................

when your condition is based on function result, you need to use having keyword

select grpcol1, grpcol2, count(c3.id) from table1 group by grpcol1, grpcol2 having count(c3.id)>1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.