With Examples

Example 1

With j As
     (Select s1.product_id, avg(s1.amount) avg_amount
        From sales s1
     Group By s1.product_id)
     Select s2.seller_id, s2.product_name, s2.unit
          Join j
       Using (product_id)
      Where s2.amount > j.avg_amount ;