<p>The epoch table is populated at the beginning of the epoch, actually more accurately at the first block received for that epoch. You can't get data that doesn't exist. If you're wondering what the next epoch is though, just take the result of that query and add 1.</p>

CC BY-SA 4.0
2021-12-14T14:09:36.653Z
2021-12-14T14:09:36.653Z
Samuel Leathers
<p>How can I get the next Epoch.No using Postgresql. If I use</p>
<blockquote>
<p>'SELECT no FROM epoch ORDER BY no desc limit 1'</p>
</blockquote>
<p>, it returned last epoch/currentEpoch, if I want to receive the next Epoch.No, what should I do? Thanks for your help</p>

<cardano-db-sync>
Query next epoch from postgresql
# Query next epoch from postgresql

(Asked by: username_0 on 2021-12-07)

How can I get the next Epoch.No using Postgresql. If I use

> 'SELECT no FROM epoch ORDER BY no desc limit 1'

, it returned last epoch/currentEpoch, if I want to receive the next Epoch.No, what should I do? Thanks for your help

**Tags:** cardano-db-sync

---

## 1 answers

### Answer by username_1 on 2021-12-14. Score: 1

The epoch table is populated at the beginning of the epoch, actually more accurately at the first block received for that epoch. You can't get data that doesn't exist. If you're wondering what the next epoch is though, just take the result of that query and add 1.


---

