The Joys of SQL:
Did you know that the SQL language allows you to do amazing analysis of data such as aggregate functions?
SELECT t.session_id, t.request_id, SUM(t.user_objects_alloc_page_count) AS UserObjectAllocated, SUM(t.user_objects_dealloc_page_count) AS UserObjectDeallocated FROM sys.dm_db_task_space_usage AS t GROUP BY t.session_id, t.request_id; … 609 more words
A common misconception when writing PL/SQL select …. into … statements is that if it is an aggregation query (a query that is using an aggregation like count, max, min, avg, etc.) then they always return a result – possibly null – so a NO_DATA_FOUND exception will never occur. 639 more words