使用"UNION [ALL]"命令,可以实现多条SQL语句结果的合并
不加"ALL"会在多条结果中进行去重,示例:
SELECT AccountID, InstrumentID, PosiDirection, Position FROM `t_FuturePosition` WHERE AccountID = '9099'
UNION ALL
SELECT AccountID, InstrumentID, PosiDirection, Position FROM `t_FuturePosition` WHERE AccountID = '99099'
ORDER BY InstrumentID
网友评论