Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to concat two varchars in jdbc/derby?

I want to run this code in JDBC/Derby but I got the below error. How can I handle it in JDBC?

Code:

   SELECT ID,Namee+ " " + Family AS NameS
   FROM Students

Errorr:

The '+' operator with a left operand type of 'VARCHAR' and a right operand type of 'VARCHAR' is not supported.
like image 757
mjyazdani Avatar asked Jun 20 '14 09:06

mjyazdani


1 Answers

Derby uses the || operator to concat strings (like Oracle):

SELECT ID, Namee || " " || Family AS NameS
FROM Students
like image 154
Mureinik Avatar answered Sep 26 '22 19:09

Mureinik