queries - select count(distinct case when ca.date >...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 select count(distinct case when ca.date > cq.deadline then cq.question_id end)/count(distinct cq.question_id) from cfw_questions cq left join cfw_qa_threads ca on ca.question_id=cq.question_id where date_asked >= '2010-09-01 00:00:00' and (is_free=0 and is_free_writing=0) and ca.type='answer' and ca.q_status='answered qae.experience,count(distinct cq.question_id)/2927*100 from cfw_questions cq left join cfw_qa_threads qt on qt.question_id=cq.question_id left join cfw_qa_survey_results ca on ca.question_id=cq.question_id left join cfw_qa_survey_experience qae on qae.eid=ca.eid where date_asked >= '2010-09-01 00:00:00' and (is_free=0 and is_free_writing=0) and ca.question_id is not null and cq.price > 000 a and q_status='answered' group by ca.eid -- cq.question_id select count(distinct case when will_recommend=1 then cq.question_id end)/count(distinct cq.question_id) -- qae.experience, c o from cfw_questions cq left join cfw_qa_threads qt on qt.question_id=cq.question_id left join cfw_qa_survey_results ca on ca.question_id=cq.question_id -- left join cfw_qa_survey_experience qae on qae.eid=ca.eid where date_asked >= '2010-09-01 00:00:00' and (is_free=0 and is_free_writing=0) and ca.question_id is not null and cq.price > 000 a and q_status='answered' -- group by ca.eid -- cq.question_id select count(distinct case when will_recommend=1 then cq.question_id end)/count(distinct cq.question_id) -- qae.experience, c o from cfw_questions cq left join cfw_qa_survey_results ca on ca.question_id=cq.question_id -- left join cfw_qa_survey_experience qae on qae.eid=ca.eid where date_asked >= '2010-09-01 00:00:00' and (is_free=1 or is_free_writing=1) and ca.question_id is not null -- group by ca.eid -- cq.question_id select qae.experience,count(distinct cq.question_id) from cfw_questions cq left join cfw_qa_survey_results ca on ca.question_id=cq.question_id left join cfw_qa_survey_experience qae on qae.eid=ca.eid where date_asked >= '2010-09-01 00:00:00' and (is_free=1 or is_free_writing=1) and ca.question_id is not null group by ca.eid -- cq.question_id select ca.eid,count(distinct cq.question_id) from cfw_questions cq left join cfw_qa_survey_results ca on ca.question_id=cq.question_id where date_asked >= '2010-09-01 00:00:00' and (is_free=1 or is_free_writing=1) and ca.question_id is not null group by ca.eid -- cq.question_id
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 2 select SUM(ltv)/count(distinct user_id) from ( select user_id,ltv from ( select ql.*, (select count(distinct csl.litle_payment_id) from cfw_litle_payments csl where csl.user_id=ql.user_id and csl.payment_succeeded=1 and csl.order_source='recurring' ) as ltv from DHRUV.qna_list ql left join cfw_questions cq on cq.user_id=ql.user_id and (cq.is_free = 1 or cq.is_free_writing=1) left join cfw_litle_subscriptions s on s.user_id=ql.user_id where cq.question_id is not null and ql.subscribe_method='pay' and s.months=1 and cq.accepted=1 ) A group by user_id ) B select count(distinct case when no_of_questions > 0 then user_id end)/count(distinct user_id)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 10

queries - select count(distinct case when ca.date >...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online