Concatenate in SQLite

I wrote before on using concatenate in OpenOffice / LibreOffice and how this alternatively can be done in R using the paste function. You can do the same in SQLite using a query too. For example if you have the table ‘Example’

A B
Combine This

you can combine A and B using the query

SELECT A, B, A || '_' || B New_Var
FROM Example

The resulting table:

A B New_Var
Combine This Combine this
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s