January 30th, 2013, 03:20 PM
Create a query off of a view and calculate a new field
I am fairly new to SQL, I have taken various courses through college and now am finally starting to development my skills in my job so please bare with me here.
I am trying to create a query that will run through two different tables, analyze two columns and based on the conditions within these two columns, create a new column with a true or false statement.
What I have so far is my query lists the information I want (excluding a new column) and has the conditions I would like to check in the WHERE statement. If [Item57Text] or [Item58Text] contain certain words I would like the new field in the new column to say true, if not I want the field to be false.
[dbo].[Q58_v2].ID 'Text ID',
Item57Text 'Question 57',
Item58Text 'Question 58'
[dbo].[Q57_v2] INNER JOIN [dbo].[Q58_v2]
(Item57Text LIKE '%CONFUSING%') OR (Item58Text LIKE '%CONFUSING%')