The "Payload" content in each Example below is editable.

Clinical Trials: Query
Below are queries performed on the imported Clinical Trials data. All 4 queries are processed by SFSQL in one request.
Please see the inline "_comment" attributes for info on each query.

[ { "query": { "sfsql": "SELECT $s:.BriefTitle ORDER BY $s:.BriefTitle LIMIT 10", "_comment": "First 10 BriefTitles irrespective of parent using a Global search by prefixing with dot" } }, { "query": { "sfsql": "SELECT DISTINCT $s:.LeadSponsor.LeadSponsorName AS 'LeadSponsorName', $s:.LeadSponsor.LeadSponsorClass AS 'LeadSponsorClass' WHERE $s:.LeadSponsor.LeadSponsorName.vci() LIKE 'University%' ORDER BY LeadSponsorClass,LeadSponsorName LIMIT 10", "data-style": "nvp", "data-format": "json", "_comment": "LeadSponsors LIKE 'University%'" } }, { "query": { "sfsql": "SELECT $i:.FullStudy.Rank as 'Rank', $s:.FullStudy.Study.ProtocolSection.IdentificationModule.NCTId as 'NCTId' LIMIT 10", "*data-format": "csv", "*data-style": "colnames", "_comment": "First 10 NCTId's and their Rank" } }, { "query": { "sfsql": "SELECT $s:.FullStudy.Study.ProtocolSection.ArmsInterventionsModule.InterventionList.Intervention.InterventionType as 'InterventionType', COUNT($s:.FullStudy.Study.ProtocolSection.IdentificationModule.NCTId) as 'count' GROUP BY InterventionType ORDER BY count DESC", "data-format": "json", "*data-style": "dataonly", "_comment": "Count of Studies (NCTId's), in DESC Order of count, by InterventionType which is located 6 levels removed from NCTId in the data" } } ]