UPDATE members a
INNER JOIN members b
on a.Recommended_By = b.ID
set a.Node = CONCAT_WS('(',b.ID,')',b.Node)

this statement to update node column from same table, but the problem is i have to execute many times to get the correct:

example :

ID Recommended_by Node
1
2 1 1
3 2 2

but i need it to be , and it done after execute many times

ID Recommended_by Node
1
2 1 1
3 2 1,2

The problem that the server i'm using does not give privilege for creating or call stored procedure , so i have to repeat the statement many times with while or loop , i dont know how

Member Avatar for LastMitch

update record from updated record

You need to be more specific. I don't know what you are trying accomplish with your query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.