不好意思,忘说了,就是select id from tablea where plan_id = 001
中取出的ID值前后顺序是什么,select tableaid,planvalue from tableb where tableaid in (select id from tablea where plan_id = 001)
结果中的ID排序就是什么,
中取出的ID值前后顺序是什么,select tableaid,planvalue from tableb where tableaid in (select id from tablea where plan_id = 001)
结果中的ID排序就是什么,
from (select id from tablea where plan_id = 001) a
left join (select tableaid,planvalue from tableb ) b
on a.id = b.tableaid
select px=identity(int,1,1),* into # from (select id from tablea where plan_id = 001)aselect tableaid,planvalue from tableb a,# b where a.tableaid=b.tableaid order by b.px