11.01.2020 Views

BDGeo - Linguagem SQL - Consultando Dados II

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• Calculando Valores Mínimos

Sintaxe:

SELECT MIN(<coluna>)

FROM <tabela>

Exemplo 1: Exibir a data da fatura do primeiro pedido.

SELECT MIN(datafatura) AS data

FROM pedido

Exemplo 2: Exibir a data de nascimento do funcionário do sexo

masculino mais velho da empresa.

SELECT TO_CHAR(MIN(datanasc),'dd/mm/yyyy')

FROM funcionario

WHERE sexo = 'M'

Linguagem SQL - Consultando Dados II 11/01/2020 8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!