SQL

From SkyWiki

Revision as of 06:39, 16 September 2008 by Martin (Talk | contribs)
Jump to: navigation, search


traditional Oracle outer join syntax

left outer join

 


right outer join

 


inner join

 


TOP SELECT

MySQL:

SELECT product, descr, email
FROM products
LIMIT 10

Oracle >= 8.1.6:

SELECT * FROM (SELECT 
JOB_NUM, 
JOB_NME, 
START_DT_GMT, 
STATUS_CD, 
rank() over(partition BY JOB_NUM ORDER BY START_DT_GMT DESC 
) rn 
FROM NM_SCHD_JOB_RUN 
) 
WHERE rn < 10

MS SQL Server: MySQL:

SELECT TOP 10 product, descr, email 
FROM products
Personal tools