开发者

Order ADODB Recordset

H there, I need to merge and order 3 recordset. I am able to merge the 3 开发者_如何学Gorecordset but I cannot use the sort method on the result recordset.

Can you help me? How can I sort a recordset manually?


You can use UNION ALL to preserve the order of the record sets that you select.

Example:

select col1,col2,col3 from table1
UNION ALL
select col1,col2,col3 from table2
UNION ALL
select col1,col2,col3 from table3

just make sure that columns are all of the same type, otherwise you might get an exception.


Is it possible to do UNION SQL queries on this data? What about doing

Query1 UNION Query2 UNION Query3 ORDER BY column1, column2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜