# SQL Query Help Needed

**URL:** <https://forum.inductiveautomation.com/t/sql-query-help-needed/28233>\
**Category:** Ignition\
**Created:** [September 12, 2019, 9:50pm UTC](https://forum.inductiveautomation.com/t/sql-query-help-needed/28233 "2019-09-12T21:50:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [September 12, 2019, 9:50pm UTC](https://forum.inductiveautomation.com/t/sql-query-help-needed/28233/1 "2019-09-12T21:50:15Z")

</div>

I don’t know if this can even be done. Maybe someone can help?

I want to query a SQL table, just 3 columns a (DateTime - BarrelTotal - Runtime)

But I need to create an “Alias Column” which is ( BarrelTotal / Runtime )

Can anyone provide or point me to how I can get this done?

Thanks

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [September 12, 2019, 9:59pm UTC](https://forum.inductiveautomation.com/t/sql-query-help-needed/28233/2 "2019-09-12T21:59:27Z")

</div>

Select Datetime, BarrelTotal, Runtime, (BarrelTotal/Runtime) as MyTitle from DB.table\_name  
where xyz  
order by abc

---

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [September 13, 2019, 12:28am UTC](https://forum.inductiveautomation.com/t/sql-query-help-needed/28233/3 "2019-09-13T00:28:25Z")

</div>

Thanks I will give it a try.
