0

Sub-Select para comparar valores ?

De que forma posso criar um sub-select para exibir o valor menor do que o atual ? --- tab. fun ------ | nome | salario | | chirs | 200 | | tom | 1200 | | alan | 800 | Exibir: tom > cris tom > alan alan > cris

8th Jan 2020, 8:25 PM
Alex Jose Silva
Alex Jose Silva - avatar
3 Réponses
+ 1
Hola Alex, decime si es algo así lo que necesitas: SELECT f.nome, ff.nome AS name FROM fun AS f JOIN fun as ff WHERE f.salario > ff.salario No tengo un IDE para probarlo pero debería funcionar. Saludos
9th Jan 2020, 7:51 AM
Nicolás Vázquez
Nicolás Vázquez - avatar
0
SELECT f.nome, ff.nome AS NAME FROM funcionarios AS f JOIN funcionarios as ff WHERE f.salario > ff.salario;
28th Jan 2020, 1:20 PM
Alex Jose Silva
Alex Jose Silva - avatar
- 1
I think you can store the values in a HashMap, sort it by value and then return the previous value. https://www.javacodegeeks.com/2017/09/java-8-sorting-hashmap-values-ascending-descending-order.html
9th Jan 2020, 8:10 AM
Julio Codesal
Julio Codesal - avatar