Neste artigo, postarei algumas funções nativas interessantes do Oracle.
Obter o conhecimento das principais auxilia bastante na administração do banco de dados e no desenvolvimento de scripts PL/SQL.
Vamos colocar a mão na massa:
-- SQRT - Devolve a raíz quadrada
SQL> select SQRT(144) from dual;
SQRT(144)
----------
12
-- MAX - Mostra o maior valor da coluna
SQL> select * from agenda order by codigo;
CODIGO NOME TELEFONE S
---------- ---------------------------------------- ---------- -
1 Fernando 1999995555 M
2 Natally 1900001111 F
3 Daniel 1199998888 M
4 Igor 1677774444 M
5 Ailton 1922229999 M
6 ANTONIO 1922229999 M
6 linhas selecionadas.
MAX(CODIGO)
-----------
6
MIN(CODIGO)
-----------
1
CODIGO NOME TELEFONE S
---------- ---------------------------------------- ---------- -
1 Fernando 1999995555 M
2 Natally 1900001111 F
3 Daniel 1199998888 M
4 Igor 1677774444 M
5 Ailton 1922229999 M
6 ANTONIO 1922229999 M
6 linhas selecionadas.
-- MAX - Mostra o maior valor da coluna
SQL> select max(codigo) from agenda;MAX(CODIGO)
-----------
6
-- MIN- Mostra o menor valor da coluna
SQL> select min(codigo) from agenda;MIN(CODIGO)
-----------
1
-- CONCAT- Concatena valores
SQL> select concat(nome, telefone) from agenda;
CONCAT(NOME,TELEFONE)
------------------------------------------------
Ailton1922229999
ANTONIO1922229999
Fernando1999995555
Natally1900001111
Daniel1199998888
Igor1677774444
Por hora, ficamos por aqui e até o próximo artigo sobre funções nativas do Oracle =)
-->