再补充下:
a: b:
serial item_id order_id
20080102042352 20080102042352 2008010204235
20080102042353 20080102042353 2008010204235
20080102042354 20080102042354 2008010204235
20080102042346 20080102042346 2008010204234
20080102042348 20080102042348 2008010204234 如在上面数据中:我想取出,第一条记录结果为
20080102042352 20080102042352 2008010204235
20080102042353 20080102042353 2008010204235
20080102042354 20080102042354 2008010204235
第二条记录结果为:
20080102042346 20080102042346 2008010204234
20080102042348 20080102042348 2008010204234
a: b:
serial item_id order_id
20080102042352 20080102042352 2008010204235
20080102042353 20080102042353 2008010204235
20080102042354 20080102042354 2008010204235
20080102042346 20080102042346 2008010204234
20080102042348 20080102042348 2008010204234 如在上面数据中:我想取出,第一条记录结果为
20080102042352 20080102042352 2008010204235
20080102042353 20080102042353 2008010204235
20080102042354 20080102042354 2008010204235
第二条记录结果为:
20080102042346 20080102042346 2008010204234
20080102042348 20080102042348 2008010204234
select * from a, b where a.serial=b.item_id and b.order_id in (select top 100 left(serial,13) from a
where flag=0 )