Linked Questions

33 votes
22 answers
225k views

How do I select last 5 rows in a table without sorting?

I want to select the last 5 records from a table in SQL Server without arranging the table in ascending or descending order.
user avatar
4 votes
1 answer
9k views

How to delete last N records in SQL Server 2008 R2 database? [duplicate]

I have a SQL Server 2008 R2 Express database with one table with rows. And when database size became about 10gb, I need to clean the N last records from this table. I need something like this, but ...
Roman's user avatar
  • 157
2 votes
1 answer
5k views

How to create jQuery slider from images in a Database?

I am working on an ASP.NET website and can't seem to find a good solution to this. I would like to create a jQuery image slider that cycles through the last 3 images added to my database. I have tried ...
Brian Brian's user avatar
1 vote
1 answer
3k views

SQL select last 100 rows and load them into data frame via pandas

I'm using pandas to do some calculations with big data sets. I'm getting my data from a local sql-database. Now I want to select the last 100 rows of my sql table and load them into my dataframe. df =...
Erwin Schleier's user avatar
0 votes
2 answers
303 views

Get all rows except last 5 rows

I have a question very similar to this one: SQL Server SELECT LAST N Rows Where I need to get all rows except the last 5 rows. How can I do that? I tried by using row_number() over (partition by ... ...
Jan's user avatar
  • 85
0 votes
1 answer
493 views

Hibernate: get last N rows ordered by id ASC

I have a table like this id name age 1 John 54 2 Emily 68 3 Tom 235 4 Jack 68 5 Harry 12 6 Ron 68 7 ... 8 ... 9 ... 68 ... ... ......
parsecer's user avatar
  • 5,014
0 votes
4 answers
124 views

In a SQL Server database, shouldn't newest entries be at the top of the tables?

I recently started at a company and working with an existing Microsoft SQL Server database. I am also new to SQL and database programming so please be kind :-) I have developed code in other languages ...
JoeChiphead's user avatar
0 votes
0 answers
272 views

How can I get the last record(s) in a large unordered table in MySQL?

If I have a table of products (> 10000 records), as the following example [products] + ------------+---------------+ | product_no | name | + ------------+---------------+ | 84756289 | ...
Gowire's user avatar
  • 1,060
-2 votes
1 answer
131 views

how can i select the last 90 rows from a table in sql?

how can i select the last 90 rows from a table in sql ?
raghad's user avatar
  • 31
0 votes
2 answers
87 views

Updating only the recent post using php and Ajax

i have an ajax script and a php file on the server that inserts new post to the database, the ajax script can post to the target php file and get a response as json data (which is decoded and echo as ...
Maxwell's user avatar
  • 147
1 vote
1 answer
83 views

Database `ORDER BY` speeds as more entries are added

I'm not very knowledgeable about databases. I would want to retrieve, say the "newest" 10 rows with owner ID matching something, and then perhaps paginate to retrieve the next "newest" 10 rows with ...
personjerry's user avatar
  • 1,085
0 votes
2 answers
80 views

Access the last entrys in the database with a java program

I am currently writing a Java program. Brief description of the component: I have an "Entries" table. This table has the following columns: Date (which is entered automatically when the user ...
singhKirat's user avatar