I have something like this:

```
With a as (select id from table_a)
select * from table_b where table_b.id > (select min(id) from a)

```

table\_a is a huge table with millions of records and I don't want to go through all the records to find the min(i) every time I want to use min(i). Is there any way for me to store the min(id) in a variable and use it in the query? Something like this :

```
With a as (select id from table_a),
b as ((select min(id) into min_id from a))
select * from table_b where table_b.id > min_id

```