You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT "Teams".name, min("Teams"."yearID") AS start_year
FROM "Teams" GROUP BY "Teams".name
which seems correct to me.
I want to now use this result (the first year a team was in the MLB) to see how many teams entered the MLB for each year. I believe the following should produce that..
print(list(_sy.start_year.count_values())
but it produces incorrect counts. When I look at the sql produced I get the following:
print(str(bz.compute(_sy.start_year.count_values(), post_compute=False)))
SELECT anon_1.start_year, anon_1.count
FROM (SELECT alias_1.start_year AS start_year, count(alias_2.start_year) AS count
FROM (SELECT min("Teams"."yearID") AS start_year
FROM "Teams" GROUP BY "Teams".name) AS alias_1, (SELECT alias_1.start_year AS start_year
FROM (SELECT min("Teams"."yearID") AS start_year
FROM "Teams" GROUP BY "Teams".name) AS alias_1) AS alias_2 GROUP BY alias_1.start_year) AS anon_1 ORDER BY anon_1.count DESC
which is incorrect. It should produce something close to:
select start_year, count(*)
from
(SELECT "Teams".name, min("Teams"."yearID") AS start_year
FROM "Teams" GROUP BY "Teams".name)
group by start_year
I would love to take a stab at fixing this myself. What I would like is for people to verify that I'm doing this correctly..
Thanks!
Billy
The text was updated successfully, but these errors were encountered:
I'm using the lahman2013.sqlite file to learn blaze. I believe the following is producing the wrong result.
produces
which seems correct to me.
I want to now use this result (the first year a team was in the MLB) to see how many teams entered the MLB for each year. I believe the following should produce that..
but it produces incorrect counts. When I look at the sql produced I get the following:
which is incorrect. It should produce something close to:
I would love to take a stab at fixing this myself. What I would like is for people to verify that I'm doing this correctly..
Thanks!
Billy
The text was updated successfully, but these errors were encountered: