I have a relatively simple query, but I cant seem to figure it out. I have two tables that contain some information that I need to retrieve. They are the checked values.
I need to join these two tables and query
WHERE udm_win_id = @param1 AND udm_app_id = @param2.
Here is the query that I have, but it is not returning all of the data that I need, because in the UDM table I have rows that dont exist in the TemplateValues table.
FROM UserDataAccessMultiTier UDM
INNER JOIN TemplateValues TV
ON TV.td_field_id = UDM.udm_field_id
AND TV.tv_value_id = UDM.udm_value_id
WHERE UDM.udm_win_id = @win_id
AND UDM.udm_app_id = @app_id;
The red outlined data is not being returned.
Basically, I need the data form the UDM table and also the corresponding udm_field_id. Also the udm_value_id is set to * in the TemplateValues table becuase it can have many different values i.e. testing 1, testing 2 etc...