Search
 
SCRIPT & CODE EXAMPLE
 

SQL

String concatenation in PostgreSQL

-- with functions
CONCAT(first_name,' ', last_name) AS full_name;

-- with string concatenation operator
SELECT first_name || ' ' || last_name AS full_name FROM customer;

-- String concatenation with a non-string input
SELECT customer_id || ': ' || first_name || ' ' || last_name AS full_name
FROM customer;
Comment

postgres concat

update "ExportTables" SET "Name" = CONCAT("Name", '.csv') 
Comment

postgresql concat string with separator

SELECT
	concat_ws (', ', last_name, first_name) AS full_name
FROM
	customer
ORDER BY
	last_name;Code language: SQL (Structured Query Language) (sql)
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle reset sequence 
Sql :: how to alter table name in mysql 
Sql :: oracle list next running jobs 
Sql :: Starting mysql shell lampp ubuntu 
Sql :: postgres delete last row 
Sql :: mssql reset auto increment 
Sql :: hibernate dialect property xml for mysql 8 
Sql :: error code 1175 mysql fix 
Sql :: mysql delete binlog 
Sql :: how to give access to database in postgresql server to another user 
Sql :: psql is not recognized 
Sql :: sql beginning of previous month 
Sql :: sql where last 12 months 
Sql :: dirinfo.name my snippets in stored procedure 
Sql :: postgres truncate with cascade 
Sql :: table infromation in sql server 
Sql :: how to check nls timestamp format in oracle 
Sql :: group by mysql and concatenate string 
Sql :: import sql file in mysql 
Sql :: list index mysql cli 
Sql :: mysql modify default value 
Sql :: add column to table sql 
Sql :: alter table change default 
Sql :: drop table in mysql 
Sql :: table drop if exist sql server 
Sql :: sql select only time from datetime 
Sql :: how to fetch alternate records from two tables 
Sql :: create mysql user 
Sql :: mysql public key retrieval is not allowed 
Sql :: data types sql 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =