100分求高效SQL!!!
clop 2006-06-23 03:13:49 应用很简单
表1 卡号明细(card_no, send_id)
SAETR00001 null
SAETR00002 1
SAETR00003 1
SAETR00004 null
SAETR00005 null
SAETR00006 2
SAETR00007 null
SAETR00008 null
表2 发送单 (send_id, start_card_no, end_card_no)
1 SAETR00002 SAETR00003
2 SAETR00006 SAETR00006
求清单
send_id start_card_no, end_card_no
null SAETR00001 SAETR00001
1 SAETR00002 SAETR00003
null SAETR00004 SAETR00005
2 SAETR00006 SAETR00006
null SAETR00007 SAETR00008
做法有很多种,循环就不考虑,主要想要高效的
谢谢