# Dropdown list binding

**URL:** <https://forum.inductiveautomation.com/t/dropdown-list-binding/6970>\
**Category:** Ignition\
**Created:** [August 1, 2013, 8:29pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/6970 "2013-08-01T20:29:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [August 1, 2013, 8:29pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/6970/1 "2013-08-01T20:29:51Z")

</div>

I have a dropdown list which gets its data from a one column returning select query.  
I would like to add a static value to this list which does not come from the database.  
How can I append my dataset with this one value?  
I am trying to avoid using a gateway script…

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [August 1, 2013, 10:27pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/6970/2 "2013-08-01T22:27:11Z")

</div>

Add the static value to your query by using a UNION

`SELECT myColumn FROM myTable 
UNION
SELECT "myStaticValue" as myColumn`

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [August 2, 2013, 2:54pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/6970/3 "2013-08-02T14:54:36Z")

</div>

Thanks Pat  
How could I then order my dataset so the static value is the first one?  
I’ve tried

```auto
ORDER BY (mycolumn = 'Static') DESC
```

and a few others

```auto
ORDER BY CASE WHEN mycolumn = 'Static' THEN 1 ELSE 2 END
```

None work for me.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [August 2, 2013, 3:31pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/6970/4 "2013-08-02T15:31:18Z")

</div>

Change the order of your select statements

`SELECT "myStaticValue" as myColumn
UNION
SELECT myColumn FROM myTable `

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [August 2, 2013, 4:28pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/6970/5 "2013-08-02T16:28:23Z")

</div>

This doesn’t seem to effect the order for me, Using MS SQL Server 2008.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [August 2, 2013, 5:15pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/6970/6 "2013-08-02T17:15:13Z")

</div>

Something like this:

```auto
(SELECT myColumn, 1 as myOrder
FROM myTable)
UNION
(SELECT "myStaticValue" as myColumn, 2 as myOrder)
ORDER BY myOrder ASC
```
