It returns error message when there is error in your syntax or when the object you referring does not exist in that particular schema/db/table. It pulls 0 rows means your query is right but there is nothing that satisfy your logic.