Query for use with Mobile Worklists

Mobile_Worklists-Lisa_Bobis.sql (3.6 KB)
I wrote this query to meet the specs provided by Lisa at Arlington Heights Memorial Library.  My library doesn’t use Mobile Worklists, so I hope their use case applies broadly to other libraries.  Enjoy.

Outside of the specific application, the query provides an example of chained CTEs (or compound CTEs) in which the Common Table Expressions defined by the WITH keyword build upon one another.  This permits an alternative to writing nested subqueries.

The other generally useful nugget found within is use of the SPLIT_PART() function, a SQL string function I never found an occasion to use until now.