本帖最后由 2267152500 于 2024-10-17 23:25 编辑
[SQL] 纯文本查看 复制代码 UPDATE CF_ITEM_INFO
SET CHAR_ITEM_ID = b.item_id
FROM CF_ITEM_INFO a,(SELECT DRESS_ID ,item_id
FROM CF_ITEM_INFO
UNPIVOT(
DRESS_ID FOR DRESS IN ([DRESS1],[DRESS2],[DRESS3],[DRESS4],[DRESS5],[DRESS6],[DRESS7],[DRESS8],[DRESS9],[DRESS10])
) AS UNPVT
WHERE
ITEM_CODE LIKE 'A%%%%'
AND (DRESS_ID <> '-' OR DRESS_ID <>'' )) b WHERE a.ITEM_ID in (b.DRESS_ID) AND (CHAR_ITEM_ID = '' OR CHAR_ITEM_ID = '-')
复制上面的sql执行下就行了,前提是DRESS列有数据才有用,用的时候最好备份下CF_ITEM_INFO表
|