亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

sql查詢出來a表的某個字段插入到b表中,同時向a表插入別的數據

sql查詢出來a表的某個字段插入到b表中,同時向a表插入別的數據

幕布斯6054654 2018-12-07 09:14:53
sql查詢出來a表的某個字段插入到b表中,同時向a表插入別的數據 ? RefundInfo_Config 字段 類型 為空 ID Int 否 AccountId Bigint 否 MaxAmount Int 否 MinAmount Int 否 RefundCount Int 否 Rate Int 否 WeekDay Int 否 ? ? ? ?select distinct accountId from B_AccBankPOS_Share where createtime>=2012-6-1這個是查a表的 想把查詢出來的數據加上1,10000,500,1,80,5插入到b表中 insert into RefundInfo_Config (AccountId,MaxAmount,MinAmount,RefundCount,Rate,[WeekDay]) select distinct accountId from B_AccBankPOS_Share where createtime>=2012-6-1,10000,500,1,80,5 ? 這樣寫不對。求指點
查看完整描述

4 回答

?
神不在的星期二

TA貢獻1963條經驗 獲得超6個贊

把SQL語句改為:

insert into RefundInfo_Config (AccountId,MaxAmount,MinAmount,RefundCount,Rate,[WeekDay]) 
select distinct accountId,10000,500,1,80,5 
from B_AccBankPOS_Share 
where createtime>='2012-6-1'
查看完整回答
反對 回復 2019-01-07
?
慕斯王

TA貢獻1864條經驗 獲得超2個贊

1 insert into RefundInfo_Config (AccountId,MaxAmount,MinAmount,RefundCount,Rate,[WeekDay])
values (select distinct accountId from B_AccBankPOS_Share where createtime>=2012-6-1),
10000,500,1,80,5
查看完整回答
反對 回復 2019-01-07
?
慕斯709654

TA貢獻1840條經驗 獲得超5個贊

View Code
 insert into RefundInfo_Config (AccountId,MaxAmount,MinAmount,RefundCount,Rate,[WeekDay]) values((select distinct accountId from B_AccBankPOS_Share where createtime>=2012-6-1), 10000,500,1,80,5)
查看完整回答
反對 回復 2019-01-07
?
蕭十郎

TA貢獻1815條經驗 獲得超13個贊

insert into RefundInfo_Config (AccountId,MaxAmount,MinAmount,RefundCount,Rate,[WeekDay]) 
select distinct accountId,10000,500,1,80,5 from B_AccBankPOS_Share where createtime>=2012-6-1

這下應該行了

查看完整回答
反對 回復 2019-01-07
  • 4 回答
  • 0 關注
  • 1185 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號