SELECT Campaign, Prem1Item, Prem1Qty, Prem1Drop, Prem2Item, Prem2Qty, Prem2Drop, Prem3Item, Prem3Qty, Prem3Drop, Prem4Item, Prem4Qty, Prem4Drop, Prem5Item, Prem5Qty, Prem5Drop, Prem10ItemPkging, AckLtr1TypeCode, AckLtr10ItemPkging, ContactID
FROM [TU FAR Before VB]
UNION ALL
SELECT Campaign, Prem6Item, Prem6Qty, Prem6Drop, Prem7Item, Prem7Qty, Prem7Drop, Prem8Item, Prem8Qty, Prem8Drop, Prem9Item, Prem9Qty, Prem9Drop, NULL, NULL, NULL, Prem10ItemPkging, NULL, AckLtr10ItemPkging, ContactID
FROM [TU FAR Before VB]
WHERE NOT
(
(Prem6Item IS NULL) AND (Prem7Item IS NULL) AND (Prem8Item IS NULL)
AND (Prem9Item IS NULL)
);
在上面的代码中,一切都很好,我只需要在表中添加一个名为Continued
equals的字段,"Y"
用于所有已创建的记录,因为它有超过 5 个项目和"N"
所有具有前 5 个项目的记录。
我想知道是否有办法做到这一点而不必完全制作一张新桌子?
提前感谢您在此问题上的任何帮助。
查克