Search the forum for "vertical pivot". There are several strategies available, depending on particular requirements (for example whether there is a known or arbitrary maximum number of rows to be pivoted). Therefore, without knowing the circumstances more fully, no-one is going to suggest "an" answe...