in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Merging two pieces of data into one cell

Last post 02-07-2010 2:25 PM by Balloony2. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-07-2010 12:55 PM

    Merging two pieces of data into one cell

    I have a table called products with three columns a, b and c

    I am trying to add the data from both the a and b columns into c, also a little bit of added text

    I have tried many ways but not with any luck..

     

    Basically this is what I am looking for...

     

    Update products

    Set c = a + “ some text “ + b;

      

    Just adding one Colum of data works fine...

     

    Update products

    Set c = a;

     

    I have searched high and low but not found any solution, any help would be gratefully received as I have run out of idea’s,

    Thanks in advance.

     

  • 02-07-2010 1:23 PM In reply to

    Re: Merging two pieces of data into one cell

    In SQLite, || is the string concatenation operator, not +.
  • 02-07-2010 1:43 PM In reply to

    Re: Merging two pieces of data into one cell

    Thanks very much sunshine, working perfectly.

     I have spent two days trying to work that one out.

  • 02-07-2010 1:52 PM In reply to

    Re: Merging two pieces of data into one cell

    That is correct. See section 4.0 of http://www.sqlite.org/datatypes.html. More generally, see http://www.sqlite.org/lang_expr.html.

  • 02-07-2010 2:25 PM In reply to

    Re: Merging two pieces of data into one cell

    I'm ashamed to say that I looked through that section several times over the last 48 hours and did NOT notice it.

     

    Thanks again for your help.
Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems