# Sorting Tables

**URL:** <https://community.hubspot.com/t/sorting-tables/19111>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [February 28, 2020, 9:40am UTC](https://community.hubspot.com/t/sorting-tables/19111 "2020-02-28T09:40:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imerial](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/imerial/32/77566_2.png) [@imerial](https://community.hubspot.com/u/imerial)\
**Post date:** [February 28, 2020, 9:40am UTC](https://community.hubspot.com/t/sorting-tables/19111/1 "2020-02-28T09:40:53Z")

</div>

Hi Community,

I have a table and I would like to sort it from the highers price to the lowest.

I know I have to use orderBy= in my query, but I’m not sure exactly how it works.

Can anyone help?  
Thank you

`{% set table = hubdb_table_rows(table_id,'assetclass__contains=Future',orderBy='what_goes_here?') %}`

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/7/87ed8e88ceced129661360220ceea60264f870f3.png)

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [February 28, 2020, 7:30pm UTC](https://community.hubspot.com/t/sorting-tables/19111/2 "2020-02-28T19:30:44Z")

</div>

You would put in the internal name of the column you want to sort by. I beliiieve if you want to go Highest to Lowest it’d be a reverse sort, so add a minus sign in front of the column name. Also, when you have multiple filters in your table function you want to use &, not commas.

`{% set table = hubdb_table_rows(table_id,'&assetclass__contains=Future&orderBy=-price') %}`
