Great, thanks. Ok, so the cleanest, correct method would be to do: CAST(1000+g as CHAR) Tom ... The Book--Playing The Percentages In Baseball ...
3766
William
williamwalbu...
May 14, 2009 11:00 am
No, I get the same results as before. CAST() seems to behave the same way Str() does for Access. From dev.mysql.com: The CAST() function takes a value of one...
3765
Tangotiger
tom@...
May 13, 2009 10:48 am
Ah-ha, so CHAR does not use any particular property. If you do this: CAST(g as CHAR(3) Then do you get the desired results? Tom ... The Book--Playing The...
3764
William
williamwalbu...
May 12, 2009 11:51 pm
These are the results if I use MAX(CONCAT(CAST(g as CHAR),"_",pos)) AS PrimPos yearid,playerid,PrimPos 1914,ruthba01,4_P 1915,ruthba01,32_P 1916,ruthba01,44_P ...
3763
Tangotiger
tom@...
May 11, 2009 8:53 pm
What happens if you change: MAX(CONCAT(1000 + CAST(g as CHAR),"_",pos)) AS PrimPos To: MAX(CONCAT(CAST(g as CHAR),"_",pos)) AS PrimPos Tom ... The...
3762
William
williamwalbu...
May 11, 2009 8:31 pm
I used CHAR(3) because the G column in the fielding table is smallint(3) in MySQL. I learned that I can actually change it to CAST(g as CHAR) and get the same...
3761
Tangotiger
tom@...
May 11, 2009 3:19 pm
Bryan, You don't have a tie-breaker in case someone plays the same number of games at two positions, do you? I would suggest that any alternative solutions be...
3760
Tangotiger
tom@...
May 11, 2009 2:50 pm
I'm surprised it works as you've laid it out (which is not to say that it's wrong, since I presume you've tested it). The reason I put "1000 + GP", is so that...
3759
Bryan Walko
bryanwalko
May 11, 2009 2:42 pm
The query that is described is a neat trick and a good concept to know, but it's not a great permanent solution. ACCESS: SELECT yearID, teamID, Pos,...
3758
William
williamwalbu...
May 11, 2009 2:41 pm
I just figured it out: SELECT f2.yearid, f2.playerid, MID(MAX(CONCAT(1000 + CAST(f2.GP as CHAR(3)),"_",f2.pos)),6) AS PrimPos, Max(f2.GP) AS GP_Pos, SUM(f2.GP)...
3757
Tangotiger
tom@...
May 8, 2009 8:58 pm
Can you show us what functions you've tried? Here's a related one in Oracle I've used (for something else): substr(min(to_char(order_id + 90000,'0000039;) || ...
3756
William
williamwalbu...
May 8, 2009 8:51 pm
Is there a MySQL equivalent to this query? I'm struggling with converting it from Access to Mysql....
3755
Tangotiger
tom@...
May 4, 2009 10:42 am
Most programming languages and DB don't like column/field names that start with digits. Instead of 2B, 3B, rename them to B2, B3. Alternatively, if you give...
3754
Sean Forman
sforman71
May 4, 2009 3:11 am
Could you point out a couple of the places where this occurs? sean 2009/5/1 htlfkbz <judsongreen@...> ... -- Sean Forman President, Sports Reference LLC ...
3753
Clem Comly
ccomly2003
May 4, 2009 1:20 am
I would guess 3B is an integer column and LIKE s/b used with CHAR columns. Use =23 or >=23 is my untested suggestion Clem ... From: moose To:...
3752
Bryan Walko
bryanwalko
May 4, 2009 1:20 am
I did just find some help documentation. It appears that a double-quote is what you want to use. Vive la difference... select * from batting where "3B" like...
3751
Bryan Walko
bryanwalko
May 4, 2009 1:19 am
The problem is likely that the query doesn't like a field name beginning with a number. I'm not certain what the syntax with OpenOffice is, but try something...
3750
Matthew Gargano
tkestars
May 4, 2009 1:18 am
Sorry or end it with ; ?...
3749
Matthew Gargano
tkestars
May 4, 2009 1:18 am
Did you try where 3b =23 or where 3b>23?...
3748
moose
hslewekim
May 3, 2009 5:11 pm
Is anyone using openoffice with the Lahman database? I am having issues when I try to make a query with the 2B and 3B data, getting errors that I do not...
3747
htlfkbz
May 2, 2009 7:52 pm
When a player plays for multiple teams in the same year, each season is listed, plus a sum of all which is noted with team titled TOT (for total) at Baseball...
3746
Jeff Zimmerman
wydiyd
Apr 17, 2009 3:16 am
Tom, I someone else was looking to do this and was using some kind of program to looked at the player's pitcher and then set the race accordingly. I look for...
3745
Craig Depken
cadpi
Apr 16, 2009 10:52 pm
Craig Depken and Jon Ford have a paper in the 2006 Journal of Socio Economics looking at the impact of race on allstar ballots. I can provide the data we used...
3744
Tangotiger
tom@...
Apr 16, 2009 3:05 pm
This post is only for those who sees this from a clinical rather than moral perspective. Please ignore this post is you are in the latter group. Can someone...
3743
Paul Riker
paulriker
Apr 13, 2009 3:45 am
I just thought it would be cool if we all shared how we utilize the data we download. I started the website www.fan-exchange.com so fans can post their...
3742
Paul Riker
paulriker
Apr 13, 2009 3:45 am
I have the 2009 mlb schedules availble to download on my site http://www.fan-exchange.com/mlb/schedule.asp Fields include homefranchid, awayfranchid and...
3741
KJOK
kjokbaseball
Mar 31, 2009 2:48 am
Don't think we've mentioned these except within a table, but here is a summary of the team ID differences between BBDB and Retrosheet: 2005 - 2008 Los Angeles...
3739
KJOK
kjokbaseball
Mar 31, 2009 2:42 am
One other note for documentation, in case this does ever get corrected, is that Retrosheet also uses the incorrect PH4 for the 1891 Philadelphia American...
3738
Sean Forman
sforman71
Mar 27, 2009 3:41 am
I should probably try to revise these using retrosheet39;s latest postseason pbp. sean 2009/3/23 dsreyn <dreynolds@...> ... -- Sean Forman President,...
3737
dsreyn
Mar 23, 2009 2:03 pm
Just reviving an old thread here, but this error still hasn't been fixed... Since this was first discussed, Retrosheet39;s PBP data has been revised for the play...