Fix column alias

* column alias is not always calculated correctly as it comes
  from a nested sub query