Sae
Sae

Reputation: 505

Add Comma in the field

i have data like

Table1-> Name, point, North,Souht,West

sae,[empty],N,S,W

I want to fill point with query because too many data to add it manualy, but I have problem with 'comma'

what U want is point-> N,S or point-> S
and what ive done is point->NS or point-> ,S

with is the best way to doit using the concat or union all? or else,

Upvotes: 2

Views: 94

Answers (1)

Mureinik
Mureinik

Reputation: 311143

You could use the concat_ws function:

UPDATE table1
SET    point = CONCAT_WS(',', north, south)

Upvotes: 1

Related Questions