Introduction This article will help you to generate an ordered, distinct, delimited string in a single query using an XML. An ordered string here does not mean an alphabetical order or numeric order of the values in a delimited string. An order means the sequence in which the data was stored. A sequence of data can be determined from the fields like timestamp, identity column or any such column. A list of values is retrieved in some order and these values are separated by a delimiter.