This is a SELECT statement that shows how to use ROW_NUMBER() to include a header-level field only once per document
In other words, if you have a query that returns the invoice header and the lines and you want the (header level) tax to be included only once in the lines, this will show you how to do that.