Like SQL, for example, but it doesn't have to be the same syntax. For example, I might want to query "which stocks on the NYSE had the greatest 1-hour price changes today?"
You can give YQL a try. I'm not sure it can do the query you want, but for example you can do:
select * from yahoo.finance.quotes where symbol in ("GOOG","AAPL","MSFT","YHOO") order by DaysValueChange
And this best thing about it - it's free.