Good day,
im currently working on a SQL query that got kinda messy and i dont know how to accomplish the last step i need. The base construct is based on 3 tables:
dbo.csv_export_160_Gewindefahrwerke
The main data tabledbo.TecDoc
Table with additional informations joined with anINNER JOIN
dbo.KW Hinweise
Table with anìdentifier
column that needs to be added to the main data table
So far so good, everything works except the addition of the 3rd table. The column containing the data to be joined on are comma seperated values inside the 1st table (dbo.csv_export_160_Gewindefahrwerke
) but differ from row to row. Something like this:
- 5,13,47,64
- 1,10,50,55,74,88
- 7,14,26,30,31,40
Those values need to be joined one by one with the 3rd table dbo.KW Hinweise
to get the text of those (dbo.KW Hinweise.Text
).
I already got some sort of solution in my other question: SQL join on string_split values, but dont know how to implement it so it actually works. Someone got an idea?
Also: Heres the current query for reference: https://pastebin.pl/view/8b9105ef
Programm used: MS SQL Server Manager Studio
Version: Microsoft SQL Server 2017 (RTM-GDR) (KB4583456) - 14.0.2037.2 (X64) Nov 2 2020 19:19:59 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 (Build 18363: )