Jump to content
Fórum Script Brasil
  • 0

Apresentar Somente Os 2 Ultimos Registros



3 answers to this question

Recommended Posts

  • 0

Como faço para que minha conulta retorne somente os 3 registros que possuem o mais alto valor num determinado campo?


Abra uma consulta nomal, vai em exibir Modo SQL e coloque o codigo sql

ex: eu tenho um tabela que se chama tabela1, que possui o compo total e data

SELECT top 3 Tabela1.Total, Tabela1.data

FROM Tabela1 order by total desc;


Ve ai, qualquer coisa retorne

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...