SELECT Id, DateTime
FROM MyDbTable
WHERE Deleted = 'F' AND (Code >= 2) AND (Type LIKE '%stock%')
order by DateTime desc
limit 100, 100
and if you also need a increasing number:
SELECT Id, DateTime, @rn := @rn + 1 as RN
FROM MyDbTable
cross join (select @rn := 0) r
WHERE Deleted = 'F' AND (Code >= 2) AND (Type LIKE '%stock%')
order by DateTime desc
limit 100, 100