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

  • SEARCH
  • Home
  • 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 6327901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:21:46+00:00 2026-05-24T17:21:46+00:00

I got a set of queries that will be interupted. Therefore I need to

  • 0

I got a set of queries that will be interupted. Therefore I need to stop the query, save the last added ID and continue adding contents from the last ID on another day.

Szenario:

1) I query data from another table (Table-A) like this:

SELECT *
FROM $table_A
ORDER BY uID ASC

2) Then I add to a table (Table-B) that “looks” like this:

|¯¯¯¯¯|¯¯¯¯¯¯¯¯|¯¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|
| uID | SubID* | Name | Foo | Bar |
|-----|--------|------|-----|-----|
|  1  |   23   | Boo  | Goo | Shu |
|_____|________|______|_____|_____|

3) For each row I query from the Table-A table I add data to the Table-B table. (Note: This table already has the uID, SubID and Name when I add the data.)

4) The query gets interrupted/stops. Then I save the uID* of the latest added row – before the queries stop – to a separate table (Table-C).

Question: How can I start the query – after interruption (let’s say on the next day) – again, but starting from the next row after last I saved on the previous day (The uID will be available).

Example:

SELECT * 
FROM $table_A
ORDER BY uID ASC
LIMIT $last_uID, COUNT $table_A (a.k.a "the last ID in the table")

Thanks!

Notes:

  • The SubID connect rows to other tables & can exist more than once.
  • UID = Unique Identifier (Auto Increment).
  • 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-24T17:21:48+00:00Added an answer on May 24, 2026 at 5:21 pm

    Well you know what the last ID added was, because it will be in table_B.

    SELECT *
    FROM $table_A
    WHERE uID > (select max(uID) from table_B)
    ORDER BY uID ASC
    

    UPDATE:

    Seems this is what is required.

    SELECT all columns
    FROM $table_A
    WHERE uID BETWEEN $last_uID_added AND $last_uID_in_table; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a set of 20 queries that each one (according to log takes
I've got a set of models that look like this: class Page(models.Model): title =
I've got a set of ViewModels that I'm binding to the ItemsSource property of
I've got fullcalendar set to query a db and return json with just a
We've got a set of forms in our web application that is managed by
I've got a sub-select in a query that looks something like this: left outer
I've got an sql query that contains a number of statements. It: sets a
I've got a site that I need to change the number of viewable items
i got to execute loads of the following queries UPDATE translations SET translation =
I am trying to set up a combo box that will display a UserName,

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.