Oracle SQL

How to select the top 3 salaries of the department..?

select * from (             select rank () over (partition by department_id order by salary desc) rn,             last_name, department_id, salary from employees )  where rn <= 3 =================== O R ======================= select FIRST_NAME, …

SQL query line break

The CHR() function is used to insert control characters into a string.  1) CHR(10) is used to insert line breaks, 2) CHR(9) is for tabs 3) CHR(13) is for carriage returns. SELECT  'Notify Party '||rownum||' : '||GET_PARTY_NAME_ADD( …

SQL Analytical function using PARTITION BY Clause

SELECT CASE             WHEN ROW_NUMBER ()                  OVER (PARTITION BY C.SUPPLIER_ID ORDER BY C.SUPPLIER_ID) =1                   THEN  C.SUPPLIER_NAME || '(' || C.SUPPLIER_ID || ')' ELSE NULL END                 SUPPLIER_NAME,…

Load More
That is All