Hi,
I have a table tblMain.
I have a query that selects data from tblMain and if the field STORE has a value that is in the list of stores in my WHERE clause, then I want to have a new field ANSWER to have the value 'Y' else 'N'.
Because the list of stores in my WHERE clause needs to be maintained, I'd rather create a lookup table tblStores so that maintenance is easier to modify the list.
The query I want would select data from tblMain and join to tblStores, then creates a new column ANSWER with the values 'Y' or 'N'.
What would this query look like?
Thanks
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
Open in new window
Before you ask, no pretty sure you cannot magically access the where clause values in the select portion of the query.