开发者

Order ADODB Recordset

开发者 https://www.devze.com 2023-04-05 06:49 出处:网络
H there, I need to merge and order3 recordset. I amable to merge the 3 开发者_如何学Gorecordset but I cannot use the sort method on the result 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

精彩评论

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

关注公众号