Sql Select With Substring In Python