我的第一个问题是VIEW模式实际上用于什么?目的是什么?如果在链接到VIEW的表中添加,删除或更改了某些内容,结果是否会自动更新?
这是我关于一些代码的问题:
我在这里使用此代码创建了一个VIEW TABLE:
json
Id喜欢在其中插入名为{this.state.safetyData.map((item, key) => {
if (item.no_images) { // HERE: add this check
return(
<View>
{item.no_images.map((image,key) => {
return(
<View>
<Text>{JSON.stringify(image.id)}</Text>
</View>
)}
)}
</View>
)
}
)}
的新列,并为每个可用行粘贴一个数字CREATE VIEW innerb_comma AS
SELECT CONCAT(Pcode, ',') AS Pcode,
CONCAT(Brand, ',') AS Brand,
CONCAT(descr, ',') AS descr,
CONCAT(Size, ',') AS Size,
Barcode AS Barcode
FROM innerb
WHERE NOT EXISTS (SELECT * FROM wms WHERE barcode = innerb.barcode)
AND Pcode like '%102';
。
答案 0 :(得分:0)
您可以在下面尝试-只需在选择列表中添加1作为数量
CREATE VIEW innerb_comma AS
SELECT CONCAT(Pcode, ',') AS Pcode,
CONCAT(Brand, ',') AS Brand,
CONCAT(descr, ',') AS descr,
CONCAT(Size, ',') AS Size,
Barcode AS Barcode, 1 as quantity
FROM innerb
WHERE NOT EXISTS (SELECT * FROM wms WHERE barcode = innerb.barcode)
AND Pcode like '%102'