Group by with multiple columns:

 Query for multiple columns in GROUP BY clause:

  1. SELECT TRUNC(Sum (Unit_price * requested_quantity), 0), date_requested

    From Wsh_delivery_details wdd, oe_order_lines_all ool

    Where ool.line_id = wdd.source_line_id

    And released_status IN (‘C’,’D’)

    GROUP BY requested_quantity, unit_price, date_requested;


Explanation:

       ·       Here we used SUM() function to get the total_delivery in the delivery table.

       ·       Released_status ‘C’  for Completed and ‘D’  for Delivered, This conditions are used to find delivered orders.

       ·      GROUP BY requested_quantity, unit_price, date_requested to group the rows based on the three columns.

 




Share:

No comments:

Post a Comment

Popular Posts

Search This Blog

Powered by Blogger.

Blog Archive

Service Support

Need our help to Learn or Post New Concepts Contact me

Blog Archive

Recent Posts

Service Support

Need our help to Learn or Post New Concepts Contact me