[Koha-devel] Deleting patrons

Chris Cormack chris at bigballofwax.co.nz
Sun Apr 3 22:50:16 CEST 2011


On 4 April 2011 08:28, Cab Vinton <bibliwho at gmail.com> wrote:
> Thanks, Chris.
>
> So, correct to say that a report like the one below would not be
> affected by patrons deleted via Koha?
>
> Checkouts by Item Type
> SELECT items.itype AS Collection, COUNT( statistics.itemnumber ) AS Count
> FROM statistics
> LEFT JOIN items ON (statistics.itemnumber = items.itemnumber)
> WHERE date(statistics.datetime) between '2009-01-01' and '2009-12-31'
> AND statistics.type IN ('issue','renew')
> GROUP BY items.itype

Nope, that would work just fine, as no join to borrowers.

>
> (Hmm ... in looking at this, maybe it needs to be revised to take into
> account deleted items?)
>
Well the left join with items, will mean you will get null rows so one
of your groups will be null
(grouping by items.itype). If you want to know the actual itemtypes
then yeah, you will need to do a union of items and deleteditems and
join to that

Chris


More information about the Koha-devel mailing list