Karen Schaefer
asked on
Help with SQL query to create and update new column
i need to create a SQL statement that will update a new column to determine if the item in column 2 is an accessory or pc.
Using a Distinct to create the unique list of the items in question, then compare to actual data
My current thought is to use a with statement to be used within a nested query, then create a switch statement contains a wildcard versions of the Unique Listing.
Here is my current attempt, please help me to create the best method to update the new column?
Using a Distinct to create the unique list of the items in question, then compare to actual data
My current thought is to use a with statement to be used within a nested query, then create a switch statement contains a wildcard versions of the Unique Listing.
Here is my current attempt, please help me to create the best method to update the new column?
WITH ItemList AS
(
select distinct VSTS_Common_ItemType as ItemType
FROM [sql1].[table1]
where
[VSTS_Common_InputPath] = 'Service Center'
and System_State in ('Closed', 'Resolved')
and Common_ResolvedDate >= '01/01/2018'
)
Select Itemlist
from itemlist
Right inner join
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Karen,
Can you explain how the accepted solution solved the problem?
Can you explain how the accepted solution solved the problem?
Even a small nudge can bring light into the problem... :-)
Please post sample data and expected results.
Also your database product and version. Getting this in the correct Topic Area will get it in front of the proper Experts.