The CONCAT function returns string1 concatenated with string2.
Concat syntax
CONCAT( string1, string2 )
Concat example
select concat('ab', 'c') from dual;
Result: abc
select concat('123', '45') from dual;
Result: 12345
select concat('PL/SQL', ' Reference') from dual;
Result: PL/SQL Reference
Concat example
STUDENT_ID |
FIRST_NAME |
LAST_NAME |
CITY |
1 |
Daniel |
SCOTT |
New York |
2 |
Anthony |
SIMMONS |
Chicago |
3 |
Sophia |
THOMPSON |
Los Angeles |
select s.STUDENT_ID,
concat(concat(s.FIRST_NAME,', '), s.LAST_NAME) as FULL_NAME,
s.CITY
from STUDENTS s ;
STUDENT_ID |
FULL_NAME |
CITY |
1 |
Daniel, SCOTT |
New York |
2 |
Anthony, SIMMONS |
Chicago |
3 |
Sophia, THOMPSON |
Los Angeles |