1 of 24

CREW

Cantankerous Reports for Extraordinary Weeding

2 of 24

Apologies . . .

3 of 24

CREWhttps://www.tsl.texas.gov/ld/pubs/crew/index.html

4 of 24

A weeding report

5 of 24

6 of 24

WHEN b.copyrightdate <= year(date_sub(curdate(),interval age year)) THEN 'Weed for age'

7 of 24

WHEN coalesce(i.datelastborrowed,i.dateaccessioned) <= date_sub(curdate(),interval last_circ year) THEN 'Weed for usage'

8 of 24

A workable option

9 of 24

10 of 24

11 of 24

12 of 24

13 of 24

14 of 24

15 of 24

16 of 24

17 of 24

18 of 24

If it’s non-fiction, do some complicated nonsense. Otherwise, use the display value of the collection code.

19 of 24

SELECT

FROM

( SELECT

FROM

(SELECT

FROM items

LEFT JOIN biblio

LEFT JOIN authorised_values

LEFT JOIN CREW [list of all items with CREW values]

) SPEW [list of all items with action]

) BLEW [subtotals grouped by action & call number]

LEFT JOIN BLEW_EE [subtotals grouped by call number]

20 of 24

21 of 24

22 of 24

23 of 24

Conclusion?

  • Work iteratively
  • Consider the path or narrative of your data
  • Subqueries are signposts or chapters
  • A code editor and some careful tabbing can make those subqueries easier to think about

24 of 24

Andrew Fuerste-Henry

andrewfh@dubcolib.org

Koha-US System Administration SIG, 10am CT,2nd Tuesday