I have 3 text columns ------------------------Col1 Col2 Col3 A B AB C D CD-------------------------How to merge Col1 and Col2 to be like Col3
i did try " update mytable set Col3 = Col1 + Col2 "
but it did't workThanks
In SQLite, to concat two strings, use double-pipes:
update mytable set col3 = col1 || col2
Thanks Robert it's works just fine ...
but one more thing ..
if i whant to concat col1 ,col2 and col3 and there is some empty cells in col3
it don't concat
Did it with
update mytable set name = col1 || " " || col2 where col3 isnull
You could have used functions ifnull(X,Y) or coalesce(X,Y,...) (See http://www.sqlite.org/lang_corefunc.html for details)
UPDATE mytable SET name = col1 || ifnull ( col3 , " " ) || col2
Thanks i'll keep your post in mind