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
About these ads

About pvanb

I am a tropical forest ecologist with a focus on spatial and temporal patterns and processes at population and ecosystem level. I am furthermore very interested in issues related to conservation and sustainable use of biodiversity and natural resources under current and future climates. I have worked in the Middle East (Syria and Lebanon) and South America (Brazil) and in Eastern Africa (Kenya).
This entry was posted in Data handling, SQLite and tagged , , , , . Bookmark the permalink.

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 )

Connecting to %s