Posted In: Database

How to concatenate db columns

MySQL

SELECT concat(u.FIRST_NM, " ", u.LAST_NM) FROM tbl_user u

Oracle

SELECT u.FIRST_NM || ' ' || u.LAST_NM FROM tbl_user u

PostgreSQL

SELECT u.FIRST_NM || ' ' || u.LAST_NM FROM tbl_user u

MongoDB

{ fullName: { $concat: [ "$firstName", " ", "$lastName" ] } }

by , on November 20th, 2017

  • Categories