Below is my query
SELECT
P.PlanName
V.Section
FROM
app.Plan P
CROSS APPLY
(VALUES ('Protective'), ('Effective'), ('EasyClaim')) V(Section);
in the query, this returns the value in V.Section, where as I want to get the value of that column from the table variable.
VALUEStable construct for this; justJOINyour tableapp.Planto the table variable *that you don't show in your question) onPlan.Protective,Effective, andEasyClaim; there's no need for theVALUEStable construct.SELECT V.Section FROM @TabVariable WHERE Name = P.[PlanName]. Assuming your table variable has a column named "Section", remove theV.from your Rating subquery. You will need to alias@TabVariableand reference that if the column names are the same.