Rajeev Kumar
How can We see last 50 Records of a Table?

How can We see last 50 Records of a Table?

By Rajeev Kumar in .NET on Jan 18 2023
  • Pavan Ramamurthy
    May, 2023 10

    Select Top 50 Column_Name from Table Order by Column_Name desc

    • 1
  • Tuhin Paul
    Apr, 2023 15

    To see the last 50 records of a table in SQL Server, you can use the TOP clause in combination with the ORDER BY clause to sort the records in descending order based on the primary key or any other column that defines the order of records in the table.

    1. SELECT TOP 50 * FROM my_table ORDER BY id DESC;

    This query selects the top 50 records from the my_table table and sorts the records in descending order based on the id column, which is assumed to be a primary key that defines the order of records in the table.

    • 1
  • Jignesh Kumar
    Jan, 2023 25

    Select top 50 from YourTableName order by YourIdColumn desc

    • 1
  • Manoj Kumar Duraisamy
    Feb, 2023 7

    SELECT * FROM table_name ORDER BY id DESC LIMIT 50;Note that this assumes that the table has a column named "id" that is used to order the records. If your table has a different column for ordering, you should replace "id" with the appropriate column name. Additionally, the order of the records can be changed from descending to ascending by changing the "DESC" keyword to "ASC".

    • 0
  • Munib Butt
    Jan, 2023 26

    Select Top 50 [Columns] from Table Order by [Column] desc

    • 0
  • Jignesh Kumar
    Jan, 2023 25

    Answer submitted multiple times. Not sure why And I do not have option to delete this answer

    • 0
  • Aravind  Govindaraj
    Jan, 2023 23

    Select top 50 with order by desc datecreated option…

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS