Reputation: 439
I need to find a solution where I can use the IF condition with "groupconcat"
select
GROUP_CONCAT(
DISTINCT bug_id)
from bugs
where sum(
IF((timediff(delta_ts,creation_ts) > "00:02:00") && (priority="P1") ,1,0)))
as bugids
It is throwing error.
ERROR 1111 (HY000): Invalid use of group function
Note:- This select query is used as an inner query.
Any solution for getting the result bug ids using groupcontact and a where condition??
Upvotes: 0
Views: 107
Reputation: 439
Got the answer.
select
GROUP_CONCAT(
DISTINCT bug_id)
from bugs
where (
IF(
(timediff(delta_ts,creation_ts) > "00:02:00") && (priority="P1")
&& (product_id=237)
&&(bugs.resolution='FIXED')
&&(bug_status="RESOLVED")
&&(bugs.creation_ts >='2013-06-14 09:00:00'
and bugs.creation_ts <= '2013-06-16 08:59:59') ,1,0)) ;
+--------------------------------+ | GROUP_CONCAT( DISTINCT bug_id) | +--------------------------------+ | 3743304 | +--------------------------------+ 1 row in set, 65535 warnings (5.86 sec)
Upvotes: 0
Reputation: 137
select GROUP_CONCAT( DISTINCT bug_id) from bugs where
sum( IF((timediff(delta_ts,creation_ts) > "00:02:00") && (priority="P1") ,1,0))
Upvotes: 1