我有一个报价,我想将该报价的最后 3 个注释放在一行中。通过从引号中选择前 3 个,我有一个 QuoteNote 表:
QuoteNoteID QuoteID Note NoteAreaID
1 1 Test 2
2 1 Test2 1
3 1 Test3 1
我在这张桌子上有一个选择,它带回了我需要的信息
SELECT q.QuoteNoteID, q.QuoteID, q.Note, q.NoteAreaID, n.Description AS NoteAreaDesc
FROM Quote q INNER JOIN QuoteNote n ON n.QuoteID = q.QuoteID
这给了我
QuoteNoteID QuoteID Note NoteAreaID NoteAreaDesc
1 1 Test 2 Internal
2 1 Test2 1 External
3 1 Test3 1 External
现在我想做的就是把它放在一排
QuoteID Note1 Note2 Note3 NoteAreaID1 NoteAreaID2 NoteAreaID3 NoteAreaDesc1 NoteAreaDesc2 NoteAreaDesc3
1 Test Test2 Tes3 2 1 1 Internal External External
任何帮助将不胜感激,谢谢