this is what i have done so far. could not get the exact result. Is this possible to check from IDnum if the corresponding ItemID has a prefix of FRU,FRUA,TXT then replicate all IDnum that has the following prefix.
Select
Item ,
IdNum,
Case When Item like '%FRUA%' THEN 'FRUA'
When Item like '%FRUB%' THEN 'FRUB'
When Item like '%TS3%' THEN 'TS'
When Item like '%FRU%' THEN 'FRU'
ELSE 'NON-FRU' END AS GetType
from #sample
Group by IdNum, Item
order by IdNum
No comments:
Post a Comment