# KSQL Query to consume after certain time from insertion

**URL:** <https://forum.confluent.io/t/ksql-query-to-consume-after-certain-time-from-insertion/2188>\
**Category:** ksqlDB\
**Created:** [9 July 2021 11:36 UTC](https://forum.confluent.io/t/ksql-query-to-consume-after-certain-time-from-insertion/2188 "2021-07-09T11:36:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manikanta.appari](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@manikanta.appari](https://forum.confluent.io/u/manikanta.appari)\
**Post date:** [9 July 2021 11:36 UTC](https://forum.confluent.io/t/ksql-query-to-consume-after-certain-time-from-insertion/2188/1 "2021-07-09T11:36:28Z")

</div>

Hello All,

I hope this message finds you all well.

I am trying to consume a row from a stream using select query, where as the row has certain properties along with the inserted time as a column. Now, I need to consume the row after 30 mins gap from its inserted time.

I tried using both tables and streams but I noticed that, the select query is applying the conditions at the time of insertion itself and as the condition does not matches at the insertion time, it is not getting consumed. But, my expectation is that, that inserted row has to be consumed after 30 minutes from the isertion time. Could any one suggest me, if it is possible to format a query for this scenario?

The select query for the stream/table that I am trying to use for the same:

insert into my\_stream values (1, ‘some data’, ‘some message’, 1625745622700);  
//1625745622700 - timestamp in milliseconds at the time of insertion.

select \* from my\_stream where rowtime \> inserted\_time\_ms + 200000 emit changes;

---

<div class="post-metadata">

**Author:** ![rmoff](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/rmoff/32/3_2.png) [@rmoff](https://forum.confluent.io/u/rmoff)\
**Post date:** [9 July 2021 12:52 UTC](https://forum.confluent.io/t/ksql-query-to-consume-after-certain-time-from-insertion/2188/2 "2021-07-09T12:52:28Z")

</div>

A post was split to a new topic: [Pull query not working](https://forum.confluent.io/t/pull-query-not-working/2190)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [8 August 2021 11:37 UTC](https://forum.confluent.io/t/ksql-query-to-consume-after-certain-time-from-insertion/2188/3 "2021-08-08T11:37:26Z")

</div>

This topic was automatically closed after 30 days. New replies are no longer allowed.
