Fixed: [ bug #1690 ] Sorting on salary table triggers SQL errors