* @param columnNo counting from 1
* @throws TranslationException
*/
public Relation orderBy(int columnNo, boolean asc) throws TranslationException {
if (columnNo == 0) {
throw new TranslationException("ORDER BY 0");
}
if (columnNo < 0) {
throw new TranslationException("wrong sort key");
}
if (columnNo > this.columns().size()) {
throw new TranslationException(String.format("ORDER BY %s, while there are only %s columns", columnNo, this.columns().size()));
}
checkArgument(columnNo <= this.columns().size());
if (asc) {
return makeNew(Utils.sortAsc(this.formula(), columnNo), this.columns(), this.expandedColumns());
} else {