syntax for Datastore: SQL Query #3853
Replies: 6 comments 1 reply
-
@tedmoorman using GET
POST
|
Beta Was this translation helpful? Give feedback.
-
@janette thank you for the response! Is there a tool you're using to go from the parameters of interest to the URL string in the GET? Or, are you just concatenating all this on your own? I would be interested in whatever process you're using for that, if you wouldn't mind posting! |
Beta Was this translation helpful? Give feedback.
-
@tedmoorman you can write the query in json, then convert it with this https://www.convertonline.io/convert/json-to-query-string or go to the filter screen, build your filters, and copy the query from the browser network tab |
Beta Was this translation helpful? Give feedback.
-
@janette thank you for the suggestion! I ended up building out the query in JSON and submitting it directly to a POST statement. R code is below:
|
Beta Was this translation helpful? Give feedback.
-
@janette do you know how to format the JSON in an "OR" statement? For example, suppose I wanted payments related to "Food and Beverage" or "Consulting". I couldn't use the following code because it works like an "AND" statement:
If there's a good resource for documentation on formatting JSON queries, please let me know. And thank you for all of your help! |
Beta Was this translation helpful? Give feedback.
-
@tedmoorman Looks like Dan got you the answer here #3855 |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm looking at CMS OpenPayments data and trying to create a query using their API. I was referred to this page for support for the API's SQL syntax. For some reason, I'm having trouble specifying "not equals" in a WHERE clause. I've tried "<>", "!=", "WHERE NOT ...". Is there some place I can go to view the syntax for an SQL query of this API?
You can select from multiple datasets here: https://openpaymentsdata.cms.gov/datasets . For example, here is a specific dataset:
https://openpaymentsdata.cms.gov/dataset/0380bbeb-aea1-58b6-b708-829f92a48202 .
For example, I can create an "equals" request URL with the following syntax:
I'm just not sure how to create the equivalent "not equals" request URL.
Thank you for taking a look at this!
Beta Was this translation helpful? Give feedback.
All reactions