我正在使用SQL Server 2008,我不确定我在这里要求的是什么,但我有一个表模式,如:
DECLARE @QuestionRowColDef TABLE
(
rId int,
rowcol int,
rowtext nvarchar(256)
)
INSERT INTO @QuestionRowColDef
SELECT 1, 1, 'row 1'
INSERT INTO @QuestionRowColDef
SELECT 2, 1, 'row 2'
INSERT INTO @QuestionRowColDef
SELECT 3, 1, 'row 3'
INSERT INTO @QuestionRowColDef
SELECT 4, 1, 'row 4'
INSERT INTO @QuestionRowColDef
SELECT 5, 1, 'row 5'
INSERT INTO @QuestionRowColDef
SELECT 6, 2, 'col 1'
INSERT INTO @QuestionRowColDef
SELECT 7, 2, 'col 2'
INSERT INTO @QuestionRowColDef
SELECT 8, 2, 'col 3'
INSERT INTO @QuestionRowColDef
SELECT 9, 2, 'col 4'
我想返回一个明确的行列表和该行的所有列。这是一个视觉表现。
row1, col1, col2, col3, col4
row2, col1, col2, col3, col4
row3, col1, col2, col3, col4
row4, col1, col2, col3, col4
提前致谢