You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
409 B
7 lines
409 B
INSERT TMemberTransHistPayment(FMemId,FCardId,FBillType,FTransId,FTransDetailId,FPayTypeId,FPayAmt,FHistId)
|
|
SELECT A.FMemId,A.FCardId,A.FBillType,A.FTransId,A.FTransDetailId,B.FPayTypeId,B.FPayAmt,0
|
|
FROM TMemberTransHist AS A,TConsumeGoodsPayment AS B
|
|
WHERE B.FBillId = A.FTransId
|
|
AND B.FDetailId = A.FTransDetailId
|
|
AND A.FBizType = 'Goods'
|
|
AND A.FTransId NOT IN(SELECT FTransId FROM TMemberTransHistPayment)
|
|
|