Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5941571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:07:44+00:00 2026-05-22T16:07:44+00:00

i save a new rows .. and it is saved so id, user, message

  • 0

i save a new rows .. and it is saved so

id, user, message
i want to get the last 25 saved
but whit this

select top 25 usuario, mensaje 
from chat  
order by idchat asc

I just get the first 25, how can i get the last 25 rows?

the table is it

create table chat
(idchat int primary key identity,
usuario varchar(50),
mensaje text);

if i execute

select top 25 usuario, mensaje from chat  order by idchat desc

it return a bad thing.. for example i a saved

'user1','mensaje1'
'user1','mensaje2'
'user1', 'mensaje3'

this returns

'user1','mensaje3'
'user1','mensaje2'
'user1', 'mensaje1'

I dont need it..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:07:44+00:00Added an answer on May 22, 2026 at 4:07 pm

    Change ASC to DESC:

    select top 25 usuario, mensaje from chat  order by idchat desc
    

    Edit: you want the last 25, but after filtering for the last 25, you want them ordered ascending?

    SELECT * FROM
        (
        select top 25 
            usuario, 
            mensaje 
        from 
            chat  
        order by 
            idchat desc
        )
    ORDER BY
      idchat ASC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I do this to save new invoince in my Invoices database table: // insert
I want to save my countries local time(new zealand) in my database. I am
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
I am trying to add new rows in my table, and save them into
I'm working on a site, and its CMS used to save new page urls
new_thing = MyTable(last_updated=datetime.datetime.now()) new_thing.save() >>>>select * from MyTable\G; last_updated: 2010-04-01 05:26:21 However, in my
public void Save() { XmlSerializer Serializer = new XmlSerializer(typeof(DatabaseInformation)); /* A first chance exception
In my app i need to save changed values (old and new) when model
I try to create a new file inside a JSP and try to save
i have 2 controllers methods create and show def create @message2 = Message.new(params[:message]) if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.