Reputation: 55
i have a table school with fields : no.reg and item like below :
table school
no.reg= A
item = book.
no.reg= B
item = chair.
i want to insert record city with comma where no.reg = A the result :
no.reg= A
item = book , ruler, eraser.
no.reg= B
item = chair
how to create a query for that ??
Upvotes: 1
Views: 36
Reputation: 4695
update school
set item = 'book, ruler, eraser'
where [no.reg] = 'A'
or if you want to append a certain value to what exists already, just concatenate what you want
update school
set item = item + ', ruler, eraser'
where [no.reg] = 'A'
Upvotes: 1