I'm trying to write a restful service that is in C# and I'm looking to query PI with queries like below. I'm not finding any code snippets on how to accomplish then. Does anybody have experience doing this? For the particular query below I'm trying to get back the stale count of a interface based on the point source and stale range I have set.
SELECT count('a') as Stalecount
WHERE tag IN (
SELECT tag FROM pipoint..classic
WHERE pointsource = 'XYZ'
and location1=5 and scan=1)
AND ((DATE('*') - time) BETWEEN RELDATE('30h') AND RELDATE('365d') OR status <> 0)
AND tag not like '*sy.st*'