title: I have to use 80/20 on the given result in SQL. There are some resources available, but I am still not able to digress them
body: <pre><code>select o.user_id, liftime_orders from
  ((select distinct user_id from app_open
   WHERE DATE (TIMESTAMP 'epoch' + TIME*INTERVAL '0.001 second') BETWEEN CURRENT_DATE -30 AND CURRENT_DATE) a
  JOIN
  
  (select COUNT (distinct order_num) AS liftime_orders,user_id
  from order_master_bi
  group by 2
  having  liftime_orders &gt;=1
  ) o
  
  ON a.user_id=o.user_id)
  </code></pre>
  <p>database is amazon redshift</p>
  <p>[the result for his query]]: <a href="https://i.stack.imgur.com/pMThz.png" rel="nofollow noreferrer">https://i.stack.imgur.com/pMThz.png</a></p>