我有 4 张不同的桌子
- 帐户,
- 分支,
- 提单者,
- tblbiller 政策,
包含其列的 4 个表
- 帐户 (accntID) 主键...
- 分支(branchID)主键...
- tblbillers (Billerid) 和
- tblbilerpolicy (PolicyID Primary Key, accountID, BranchID, BillerID, Enabled, ServiceCharge, MerchantCOmission,PLUCode)
现在我想像这样插入表 tblbilerpolicy:
INSERT INTO dbo.tblbillerpolicy
(
AccountID ,
BranchID ,
BillerID ,
Enabled ,
ServiceCharge ,
MerchantComission ,
PLUCode
)
Select 142, 2171, 2, 'YES', 0.00, 3.50, 'NULL'
UNION ALL
Select 143, 2171, 2, 'YES', 0.00, 3.50, 'NULL'
UNION ALL
Select 143, 2171, 2, 'YES', 0.00, 3.50, 'NULL'
UNION ALL
Select 143, 2171, 2, 'YES', 0.00, 3.50, 'NULL'
where AccountID = accntid <-- for account
and BranchID = branchid <-- for branch
and BillerID = billerid <-- for tblbillers
现在我真正想做的是将这个“ONLY”插入与上述表(帐户,分支,账单)连接的tblbillerpolicy。,