add desc condition to select query to control building query