# Loop hubdb table rows in reverse order

**URL:** <https://community.hubspot.com/t/loop-hubdb-table-rows-in-reverse-order/18791>\
**Category:** CMS Development\
**Created:** [February 14, 2020, 12:45pm UTC](https://community.hubspot.com/t/loop-hubdb-table-rows-in-reverse-order/18791 "2020-02-14T12:45:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suonpera](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/suonpera/32/93635_2.png) [@Suonpera](https://community.hubspot.com/u/Suonpera)\
**Post date:** [February 14, 2020, 12:45pm UTC](https://community.hubspot.com/t/loop-hubdb-table-rows-in-reverse-order/18791/1 "2020-02-14T12:45:25Z")

</div>

Hey Friends,

Currently using this to loop through a table  
{% for row in hubdb\_table\_rows(‘2594592’, ‘GET’) %}

But I need it in the reverse order, so I can display the most recent rows first.

How do I do that?

Couldn’t find any similar examples in the documentation.

Thanks!

---

<div class="post-metadata">

**Author:** ![prosa](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/prosa/32/4387_2.png) [@prosa](https://community.hubspot.com/u/prosa)\
**Post date:** [February 14, 2020, 2:53pm UTC](https://community.hubspot.com/t/loop-hubdb-table-rows-in-reverse-order/18791/2 "2020-02-14T14:53:49Z")

</div>

`{% for row in hubdb_table_rows('2594592', '&orderBy=-hs_created_at') %}`

Notice the ‘-’ symbol
