Friday, August 08, 2008

Concatenating String Fields in SQL (Oracle)

To concatenate 2 string fields in a select statement use the || operator (C#'s OR)

select firstName || ' ' || lastName as Name from tblNames;

Outputs:

Name

Barack Obama

George Bush

George Washington

Also, string constants are defined by single quotes (')

No comments: