RAZ-3302: SQL error when counting aliases
- Fixed list being empty and throwing SQL error