Executes a SQL QUery from a string and returns a single value