This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

terça-feira, 28 de agosto de 2012

Comando TOP no Oracle


No Oracle não existe o comando TOP como existe no SQL, ou um equivalente. Logo para se conseguir o mesmo comportamento é necessário fazer uma query que tira partido do campo escondido ROWNUM que todas as tabelas em Oracle têm. A query para obter o TOP 10 ficará algo como:




SELECT * FROM (
       SELECT * FROM MY_TABLE ORDER BY TABLE_FIELD
)
WHERE ROWNUM <= 10 ORDER BY ROWNUM