Viewing 6 posts - 1 through 6 (of 6 total)
Thanks all, for your post and comments. Very helpful.
I figured it out / Solution:
select t.topic_key, t.topic_name,
COUNT(CASE WHEN
uel.event_id='1'
and u.intent_id = '2'
THEN u.user_id END) AS numCouldHelp,
COUNT(CASE WHEN
uel.event_id='1'
and u.expertise_id != '1'
THEN u.user_id END)...
February 21, 2012 at 1:07 pm
My mistake !! Sorry about that...goggled search "SQL query" and got mixed up with SQL Server !
February 21, 2012 at 10:26 am
Thank you ,
select abc = count(u.user_id CASE
WHEN
u.topic_id = '95'
and uel.event_id='1'
and u.intent_id = '2'
THEN 1 ELSE 0 END),
def = count(u.user_id CASE
WHEN
u.topic_id = '95'
and uel.event_id='1'
and u.expertise_id != '2'
THEN 1 ELSE 0 END)
FROM
topic...
February 21, 2012 at 10:19 am
I am trying to use the count function twice on the same attribute
count(u.user_id) but with different conditions on the same tables.
Is there another way around ?
Thanks!
February 21, 2012 at 9:39 am
Thank you all for your responses.
I tried to simplify the problem into a table but this is my actual query where I am stuck:
select numInterested = (count(u.user_id)
...
February 21, 2012 at 8:59 am
Viewing 6 posts - 1 through 6 (of 6 total)