N
neal_wang
Unregistered / Unconfirmed
GUEST, unregistred user!
跪求SQL语句<br>数据库为MSSQL<br>表A<br>NO PN DESC QTY Manu<br>P1 PN1 PN1 DESC 10 M1<br>P2 PN2 PN2 DESC 15 M2<br>.....<br>表B<br>ID NO PN DESC QTY Manu T<br>PD001 P0 PN0 PN0 DESC 4 M0 T0<br>PD002 P1 PN11 PN11 DESC 6 M0 T1<br>PD003 P4 PN14 PN14 DESC 5 M0 T4<br>PD004 P2 PN12 PN12 DESC 4 M0 T2<br>ID是表B的主键,为PD+序列号,如果NO相同则T的值相同<br><br>现在需要将表A和表B合并<br><br>结果为<br>表B<br>ID NO PN DESC QTY Manu T<br>PD001 P0 PN0 PN0 DESC 4 M0 T0<br>PD002 P1 PN11 PN11 DESC 6 M0 T1<br>PD003 P4 PN14 PN14 DESC 5 M0 T4<br>PD004 P2 PN12 PN12 DESC 4 M0 T2<br>PD005 P1 PN1 PN1 DESC 10 M1 T1<br>PD006 P2 PN2 PN2 DESC 15 M2 T2