这是我的查询,注释行是我要插入的内容
insert into tbl_StockTransactions(ItemCode,TransactionDate,Narration,Docid,ReferenceNo,Qty,Price,UserId,BranchCode,StaffCode) select ItemCode,getDate(),Description,PostingDocid,'New Ref',Qty,Price,'uid','bc','sc' from tbl_PostingDetailsStock where PostingReference='A000275'
--select ItemCode,getDate(),Description,PostingDocid,'New Ref',Qty,Price,'uid','bc','sc' from tbl_PostingDetailsStock where PostingReference='A000276';
答案 0 :(得分:3)
试试这段代码:
insert into tbl_StockTransactions(
ItemCode, TransactionDate, Narration, Docid, ReferenceNo, Qty,
Price, UserId, BranchCode, StaffCode
)
SELECT ItemCode, getDate(), Description, PostingDocid, 'New Ref', Qty,
Price, 'uid', 'bc', 'sc'
FROM tbl_PostingDetailsStock
WHERE PostingReference IN ('A000275','A000276')
答案 1 :(得分:0)
insert into tbl_StockTransactions(ItemCode,TransactionDate,Narration
,Docid,ReferenceNo,Qty,Price,UserId,BranchCode,StaffCode)
select ItemCode,getDate(),Description,PostingDocid,'New Ref',Qty,Price,'uid','bc','sc' from tbl_PostingDetailsStock
where PostingReference IN ('A000275','A000276')
答案 2 :(得分:0)
df = sqlContext.read.json("hdfs://ip:port/user/ABC/examples/src/main/resources/people.json")