任何人都可以帮我解决这个脚本我做错了什么.....
insert ignore into `sales`.`salesm`
SELECT
`sales_imp`.`mktcd`,
sum(`sales_imp`.`sales_qty_dtl`),
'0',
sum(`sales_imp`.`sales_value_dtl`),
'0',
`sales_imp`.`yyyymm`,
`nk_mktcd_itemcd_container_id`,
`nk_mktcd_itemcd`,
concat(`nk_mktcd_itemcd`,`sales_imp`.`yyyymm`),
`agentcd`,
`nk_mktcd_agentcd`,
concat(`sales_imp`.`mktcd`,`sales_imp`.`agentcd`,`sales_imp`.`buyer_id_dtl`),
concat(`sales_imp`.`mktcd`,`sales_imp`.`agentcd`,`sales_imp`.`producer_id_dtl`),
concat(`sales_imp`.`mktcd`,`sales_imp`.`agentcd`,`sales_imp`.`salesman_id_dtl`),
`nk_clssiz`
FROM `sales`.`sales_imp`
group by
`sales_imp`.`mktcd`,
`sales_imp`.`classid`,
`sales_imp`.`sizeid`,
`sales_imp`.`yyyymm`,
`nk_mktcd_itemcd_container_id`,
`nk_mktcd_itemcd`,
`buyer_id_dtl`,
`sales_imp`.`producer_id_dtl`,
`sales_imp`.`salesman_id_dtl`,
`agentcd`,
`nk_mktcd_agentcd`,
`nk_mktcd_agentcd_buyer_id`,
`nk_mktcd_agentcd_producer_id`,
`nk_mktcd_agentcd_sman_id`,
`nk_clssiz`;
答案 0 :(得分:0)
目标表中的列数似乎与您为其插入值的列数不同。尝试命名要插入数据的列:
import React from "react";
import ReactDOM from "react-dom";
class Example extends React.Component {
constructor(props) {
super(props);
this.state = {
array: [{ n: 0 }, { n: 1 }, { n: 2 }]
}
}
render() {
return <div>
<ul> {
this.state.array.map((item,key) => {
return <li key={key} >{item.n} </li>
})
}
</ul>
<button onClick={this.updateLast}>update first</button>
</div>
}
updateLast = () => {
this.selectObjectFromArray(this.state.array.length -1 )
}
selectObjectFromArray = index => {
// create a copy of the array
let newArr = this.state.array;
// the item variable is optional but hope clarifies how this works
let item = newArr[index];
item = {
n: item.n * 2
}
newArr[index] = item;
// update the state with the new data
this.setState({
array: newArr
})
}
}
const rootElement = document.getElementById("root");
ReactDOM.render(<Example />, rootElement);