Skip to content

Instantly share code, notes, and snippets.

Created April 19, 2016 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b3aac9555a30d17b7ccf6961419e8ef8 to your computer and use it in GitHub Desktop.
Save anonymous/b3aac9555a30d17b7ccf6961419e8ef8 to your computer and use it in GitHub Desktop.
SELECT l_returnflag,
l_linestatus,
Sum(l_quantity) AS SUM_QTY,
Sum(l_extendedprice)AS SUM_BASE_PRICE,
Sum(l_extendedprice * ( 1 - l_discount ))AS SUM_DISC_PRICE
FROM lineitem
GROUP BY l_returnflag,
l_linestatus
ORDER BY l_returnflag,
l_linestatus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment