# Query for use with Mobile Worklists

**URL:** https://forum.innovativeusers.org/t/query-for-use-with-mobile-worklists/3044
**Category:** Sierra Repository
**Tags:** inventory, chained-cte, sierra, sierra-sql, mobile-worklists
**Created:** [September 14, 2026, 5:48pm UTC](https://forum.innovativeusers.org/t/query-for-use-with-mobile-worklists/3044 "2026-09-14T17:48:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bgaydos](https://forum.innovativeusers.org/user_avatar/forum.innovativeusers.org/bgaydos/32/1045_2.png) [@bgaydos](https://forum.innovativeusers.org/u/bgaydos)
#### Post date: [September 14, 2026, 5:48pm UTC](https://forum.innovativeusers.org/t/query-for-use-with-mobile-worklists/3044/1 "2026-09-14T17:48:33Z")

</div>

**[Mobile\_Worklists-Lisa\_Bobis.sql](https://forum.innovativeusers.org/uploads/short-url/g76WEDu1uByJ8SvGTwoYHzTg4wE.sql)** (3.6 KB)  
I wrote this query to meet the specs provided by Lisa at **[Arlington Heights Memorial Library](https://ahml.info/)**.&nbsp; My library doesn’t use Mobile Worklists, so I hope their use case applies broadly to other libraries.&nbsp; Enjoy.

Outside of the specific application, the query provides an example of **[chained CTEs](https://motherduck.com/glossary/common-table-expressions-ctes/)** (or compound CTEs) in which the Common Table Expressions defined by the WITH keyword build upon one another.&nbsp; This permits an alternative to writing nested subqueries.

The other generally useful nugget found within is use of the **[SPLIT\_PART()](https://w3resource.com/PostgreSQL/split_part-function.php)** function, a SQL string function I never found an occasion to use until now.
