On 4 April 2011 08:28, Cab Vinton <[email protected]> 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
_______________________________________________
Koha-devel mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to