Lets say i wanted to build a string value up, based on the contents of a table e.g.
select * from tableA
would return results such as
ID | Name
And say i wanted to populare a variable which loops through each row and stores/concatinate it value based on a simple look up via a case statement e.g.
For each loop i need to perform a case select e.g. in non sql it would look something like
dim value as string
for each row in collection
select case row.name
value += row.name & 'isfromspain '
value += row.name & 'isfromusa '
value += row.name & 'isfromUK'
so the output would be
bobisfromspan edisfromusa bobisfromuk
Obivously my real query is far more complex and the example above is made up, however is there a way to cycle through each row, perform a check, and then concatinate?