DFDavid Ferrolindavidferrol.hashnode.dev·Sep 16, 2025 · 1 min readOracle APEX download csv exampledeclare l_csv clob; l_line varchar2(4000); begin -- Add headers (Replace with your actual column names) l_line := '"COLUMN1","COLUMN2"'; l_csv := l_line || chr(10); -- Loop through data (Replace with your table or query) for rec in ( select COL...00
DFDavid Ferrolindavidferrol.hashnode.dev·May 14, 2025 · 1 min readSubqueriesUse subqueries when you need to pass the result of one query as input to another, often for filtering or comparisons. Example: Find Employees Who Earn More Than Their Departments Average SELECT employee_id, name, salary FROM employees e WHERE salar...00
DFDavid Ferrolindavidferrol.hashnode.dev·May 14, 2025 · 1 min readSelf-JoinsSelf-joins are used to compare rows within the same table, often for hierarchical data. Example: Find Employees and Their Managers SELECT e.employee_id, e.name AS employee_name, m.name AS manager_name FROM empLoyees e LEFT JOIN employees m...00
DFDavid Ferrolindavidferrol.hashnode.dev·May 14, 2025 · 2 min readWindow FunctionsAggregate Functions (Used for calculations over a set of rows) SUM(): Calculates the sum of values over a window. AVG(): Calculates the average of values. MIN(): Finds the minimum value. MAX(): Finds the maximum value. COUNT(): Counts rows over ...00
DFDavid Ferrolindavidferrol.hashnode.dev·May 14, 2025 · 1 min readCommon Table Expressions (CTEs)CTEs simplify complex queries by breaking them into readable parts and allow for reusable temporary result sets. Example: Using Two CTEs and Joining Them Scenario: Find total sales per employee and compare it to their department's average sales. WITH...00