I have a table in a SQL-Server database (SQL-Server 2016) with 2 fields:
ConcateCode
ID int,
Random nchar(5)
ID Random
1 A2dd4
2 2f4mR
3 dhu9q
4 0lpms
Now I need a query where I get all the Random-fields concatenated in one field from Start-ID to End-ID, e.g. something like
SELECT ConcateCode FROM Table WHERE ID >= 1 AND ID < 5
and returns A2dd42f4mRdhu9q0lpms
.
The problem is that I can't use a StoredProcedure, because my Programming-Language doesn't support Stored-Procedures, but only direct table access or queries.
The question sounds stupid easy, but I try to solve the problem now for a week and get no solution. Hope someone is more intelligent than me.