MLB - Last 10 games (w/l) from a specific date

254 views
Skip to first unread message

Robert Carnatz

unread,
Apr 15, 2024, 9:51:46 PM4/15/24
to SportsDataBase
New to the SDQL, Trying to figure out how to get the last 10 win/loss record as of a certain date for each team 

Example: As of 04/30/23 the Rays had a last 10 record of 7-3, Pirates 8-2, and Oriels 8-2 

Thanks 

Joe Meyer

unread,
Apr 16, 2024, 5:53:26 PM4/16/24
to sportsd...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "SportsDataBase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sportsdatabas...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sportsdatabase/f429b429-5a85-497e-8581-810b03f15ed7n%40googlegroups.com.

Robert Carnatz

unread,
Apr 16, 2024, 8:33:01 PM4/16/24
to SportsDataBase
Thank you Joe, this is a great start. Do have more questions. What does the R mean in R(team)  and S in S(W,N=10)?  Also i need this for a specific date so i added the date at the end of your example and got dashes where the Win Loss would be 

R(team),S(W,N=10),S(L,N=10)@team and date = 20230430

Thanks again 

Joe Meyer

unread,
Apr 17, 2024, 11:57:30 AM4/17/24
to sportsd...@googlegroups.com
The SDQL manual is useful at:

Gambrinus

unread,
May 18, 2024, 10:55:03 AM5/18/24
to SportsDataBase
Robert, 

To see the last 10 win/loss record as of a certain date for each team, add " and date<20240501" to Joe's query to see the teams records in their last 10 games as of 5/1/2024 as an example.

MLB Team records over the last 10 games as of 5/1/2024

mrpi...@gmail.com

unread,
May 31, 2024, 9:25:02 AM5/31/24
to SportsDataBase
To add to this, last 10 games with won/loss record, if I also wanted to see the ML ROI I tried adding tS(su_profit/su_invest) and got no error but all zeroes for results

Gambrinus

unread,
May 31, 2024, 9:12:48 PM5/31/24
to SportsDataBase
Hey Mr. Pickem, I hope you're well buddy. Try it this way:

mrpi...@gmail.com

unread,
Jun 2, 2024, 6:38:29 AM6/2/24
to SportsDataBase
Thanks Gambrinus
I am aware it's possible like that in the generic form, but I like to return custom tables to fit my needs,  It works at killersports which was down Friday morning and I was scrambling :)  Is there no parameter like su_profit, su_invest, su_roi, ml_profit...

I fit the results into my spreadsheet to draw from for a small piece of my model, I look to return something I can copy/paste and get this and a few others

Gambrinus

unread,
Jun 2, 2024, 3:05:47 PM6/2/24
to SportsDataBase
I see, GimmeTheDog calculates those values as needed, but now I see the value of adding them to the database. I'll get that done soon.

Also, if you're interesting in a trick to no longer have to cut-and-paste to get the data you want into your spreadsheets, email me at in...@gimmethedog.com.  

Robert Carnatz

unread,
Jun 21, 2024, 8:31:39 PM6/21/24
to SportsDataBase
A little off topic, is there a way control the order in Ascending or Descending order? In SQL it would be ORDER BY blaaa ASC

Gambrinus

unread,
Jun 30, 2024, 2:37:36 PM6/30/24
to SportsDataBase
It's not exactly what you're asking, but at GimmeTheDog.com, using the column output option (i.e., the SDQL has a "@"), the first column auto-sorts from lowest to highest. So, if you want to see the average points per game in the WNBA, use this.
  • tA(points),R(team)@team and season=2024
https://www.gimmethedog.com/WNBA?q=tA(points)%2CR(team)%40team%20and%20season%3D2024
Reply all
Reply to author
Forward
0 new messages