I am inserting data in table with current system time like System.currentTimeMillis(). So, while getting data I need to take last 3 hours data only.
System.currentTimeMillis()
Try this:
SELECT * FROM Table1 where julianday(timestamp) >= (julianday('now')-108000000)