Subsequent queries

26 views
Skip to first unread message

John Currey

unread,
May 22, 2022, 2:31:22 PMMay 22
to SDQL API

Joe Meyer

unread,
May 27, 2022, 1:11:32 PMMay 27
to sdq...@googlegroups.com
John and SDQLAPI Friends,

I see that the first 2 are  'irregular' queries: they have a combination of aggregator and non-aggregator fields.
The 3rd one works because the fields are all aggregators.

Best regards,

Joe Meyer
Sports Database LLC


--

---
You received this message because you are subscribed to the Google Groups "SDQL API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sdqlapi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sdqlapi/28c2b992-c408-4e0f-8d01-9be1bc142c1bn%40googlegroups.com.

John Currey

unread,
May 27, 2022, 6:28:44 PMMay 27
to SDQL API
Got it, thanks!

John Currey

unread,
May 28, 2022, 9:11:54 PMMay 28
to SDQL API
I thought I understood, but I do not. I'm sure those queries worked as is in S2. 

Here is the example from the Subsequent Queries page of the manual - https://s3.sportsdatabase.com/static/Manual/subsequent.html.
  • date,R(team),A(W) @ tA(points) > 10+oA(points) and team | $2,$3 @ 20170112 in $1
Not all parameters in that example are aggregators. The query fails:


Thanks

Joe Meyer

unread,
May 29, 2022, 10:02:50 AMMay 29
to sdq...@googlegroups.com
John and SDQLAPI Friend,

I see that, indeed, SDQL3 is not handling irregular queries properly.

Thanks for the good debugging and I'll get my best Python programmer on that.

Best regards,

Joe Meyer
Sports Database LLC

Joe Meyer

unread,
May 30, 2022, 8:16:51 PMMay 30
to sdq...@googlegroups.com
John and SDQL API Friends,

I believe subsequent queries are now working correctly.

Please let me know if you continue to see errors.

Best regards,

Joe Meyer
Sports Database LLC

John Currey

unread,
May 31, 2022, 6:43:17 PMMay 31
to SDQL API
Thanks Joe!

John Currey

unread,
Jun 26, 2022, 1:17:41 PMJun 26
to SDQL API
I'm trying a simple subsequent query. I believe it should show home teams and their opponent who are playing on 6/26. It's only showing the Twin and White Sox who are not playing each other today and the Twins are away. 

https://s3.sportsdatabase.com/MLB/query.html?sdql=date%2CR%28team%29%2CR%28o%3Ateam%29%2CR%28site%29%40season%3D2022+and+H+%7C+%242%2C%243%2C%244%4020220626+in+date&submit=++S+D+Q+L+%21++


Thanks. 

Joe Meyer

unread,
Jun 26, 2022, 2:12:48 PMJun 26
to sdq...@googlegroups.com
John and SDQL Friends,

The Replace aggregator provides the last value of its argument for each query group.

The R(team) in your primary SDQL:

date,R(team),R(o:team),R(site)@season=2022 and H  

simply provides the last value of team for season=2022 and H - which happens to be the White Sox

To build a subsequent query, I'd suggest first looking at the results of the primary query.

best regards,

Joe Meyer
Sports Database LLC

John Currey

unread,
Jun 26, 2022, 3:40:00 PMJun 26
to SDQL API

Joe Meyer

unread,
Jun 26, 2022, 4:12:13 PMJun 26
to sdq...@googlegroups.com
John and SDQL Friends,

I think you want to start with finding the dates of all team-opp matchup, like this:

date,R(team),R(o:team)@season=2022 and H and team and o:team|


Best regards,

Joe Meyer
Sports Database LLC

John Currey

unread,
Jun 26, 2022, 4:49:01 PMJun 26
to SDQL API
OK, got it.  Thanks. 

John Currey

unread,
Jun 26, 2022, 5:15:14 PMJun 26
to SDQL API
I notice that the alias works as expected in the subsequent query as a field, but the alias defined in the main query does not become the column heading when the $variable is used as it did in S2. 

Reply all
Reply to author
Forward
0 new messages