SQL string concatenation function string concatenation function in SQL we learn to use Concat (), the syntax for Concat () is as follows: Concat (string 1, String 2, String 3, ...): string 1, String 2, String 3, and other words concatenated together. Note that Oracle's concat () only allows two parameters, in other words, only two strings can be concatenated at a time. However, in Oracle, we can use ' | | ' To concatenate multiple strings at once.
Select Region_name + ' + store_name from geography
where store_name = ' Boston ';
Instance method
A:
ID value
1 111111111
2 222222222
3 333333333
Table B:
ID data
9 11-11111-11
10 22-22222-22
11 33-33333-33
SELECT * from a where substring (value,1,2) + '-' + substring (value,3,5) + '-' + substring (value,8,2)
Not in (select B from data);
Method Two
SELECT *
From a
Where (substr (value, 0, 2) | | '-' || substr (Value, 2, 5) | | '-' ||
substr (Value, 8, 9)) not in (select B from data);
or update value directly
Update a set value= (substr (value, 0, 2) | | '-' || substr (Value, 2, 5) | | '-' ||
substr (Value, 8, 9));
If not Oracle, SUBSTR replaced substring, | | Replace with +