Skip to main content

select count(distinct a.userid) as users, b.m_name from Table1 a,Table2 b where a.conid=b.vid_id 

 

and b.m_name and a.duration>0 and b.runtime>0 

 

group by b.m_name,a.duration,b.runtime having sum(a.duration)/b.runtime >=50

답변 31개
  1. 2021년 6월 22일 오전 2:30

    Thanks for providing the sample.​

    As some users have 2 or more records per movie, you have to get SUM of Duration but while you must NOT summarize Runtime. So the calculation of percentage should be

    Thanks for providing the sample.​As some users have 2 or more records per movie, you have to get SUM of Duration but while you must NOT summarize Runtime.キャプチャキャプチャAnd then you can calculate the percentage of users who spent time to see the movies.

    キャプチャ<compute using for table calculation>

    キャプチャ

0/9000