limit variable scoping
[google-map-tiles.git] / koha-import.pl
index 6729adc..aa7805b 100755 (executable)
@@ -166,3 +166,20 @@ while( my $row = $sth->fetchrow_hashref ) {
                , dump($location)
        );
 }
+
+eval { $g_dbh->do(qq{ drop table geo_count }) };
+$g_dbh->do(qq{
+
+select
+       count(biblionumber)
+       ,point(lat,lng)
+       ,geo_city.city
+       ,country
+into geo_count
+from geo_biblioitems
+join geo_city on city_koha = geo_biblioitems.city
+where length(geo_city.city) > 1
+group by geo_city.city, country, lat, lng
+order by count(biblionumber) desc
+
+});