Hi,

On 01/09/2012 03:30 PM, Mike Hafen wrote:
I've seen UNION used to join those two tables in queries.  I'm
imaginning something like:

SELECT YEAR(issuedate), MONTH(issuedate), categorycode, COUNT(DISTINCT
borrowernumber)
FROM (
   SELECT issuedate,categorycode,borrowernumber FROM old_issues
  UNION ALL
   SELECT issuedate,categorycode,borrowernumber FROM issues
  )
LEFT JOIN borrowers USING (borrowernumber)
GROUP BY YEAR(issuedate), MONTH(issuedate), categorycode;

A UNION ALL is indeed a valid way to do it.

Regards,

Galen
--
Galen Charlton
Director of Support and Implementation
Equinox Software, Inc. / The Open Source Experts
email:  g...@esilibrary.com
direct: +1 770-709-5581
cell:   +1 404-984-4366
skype:  gmcharlt
web:    http://www.esilibrary.com/
Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
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