What is the difference between "in ascending order" and "in an ascending order" [closed]

"an" is not required. The following sentence is perfectly acceptable:

All records in the dataset are sorted in ascending order, based on their distances to the hub node.

In fact, it would sound kind of weird to use "in an ascending order". Everybody would understand what you mean, and it's not grammatically incorrect, but "in ascending order" is by far the more common construction, at least when you're talking about data. On COCA, "in an ascending order" only has 2 hits (both of which are in a non-data context), while "in ascending order" has 42 hits.

Note: all of the above comments also apply to "in a descending order" vs. "in descending order".