R Cannot Find Count Function In Sql