Importing data from a cloud database using a local variable

Importing data from a cloud database using a local variable

I need to import data from a cloud database but restrict the query to records that have a value in a sequence column that is greater than the last import.
ie select * from mytable where ID > MAX(local copy of ID)

Is there anyway to do this, maybe with a local variable?  Retrieving close to a million rows needlessly every refresh doesn't make much sense......