A conceptually simple approach is to use SQL aliases as shown here (untested):
Code:
# get users
db_multirow users nx {
select user_id as id, username as label from users
}
# get jobs
db_multirow jobs nx {
select job_id as id, job_title as label from jobs
}
Templates:
<include src="../select-widget" &datasrc="users" />
<include src="../select-widget" &datasrc="jobs" />
Included template:
<select>
<multiple name="datasrc">
<option value="@datasrc.id@">
@datasrc.label@
</option>
</multiple>
</select>