All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sql.presto.tpch.q17.sql Maven / Gradle / Ivy

There is a newer version: 350
Show newest version
SELECT 
  sum(l.extendedprice)/7.0 as avg_yearly 
FROM 
  "${database}"."${schema}"."${prefix}lineitem" l,
  "${database}"."${schema}"."${prefix}part" p
WHERE 
  p.partkey = l.partkey 
  AND p.brand = 'Brand#23' 
  AND p.container = 'MED BOX'
  AND l.quantity < (
    SELECT 
      0.2*avg(l.quantity) 
    FROM 
      "${database}"."${schema}"."${prefix}lineitem" l
    WHERE 
    l.partkey = p.partkey
  )
;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy