我有一个以下结构的表格:
Title text
LineNo integer
Key text
Value text
我创建了一个数据透视表,用于将行数据转换为列名:
SELECT * FROM
(SELECT Title, [Key],[Value] FROM Table1 WHERE [Key] LIKE 'Field_%' AND [LineNo]>0) as Data
PIVOT(
MAX([Value])
FOR [Key] IN([Field_1],[Field_2],[Field_3])) As Piv
现在我如何按标题订购数据,然后订购行号?