Home > database >  In similar sqlsever in oracle, please left (t_cont, CHARINDEX (' : 't_cont) - 1) how to wr
In similar sqlsever in oracle, please left (t_cont, CHARINDEX (' : 't_cont) - 1) how to wr

Time:09-17

In similar sqlsever in oracle, please left (t_cont, CHARINDEX (' : 't_cont) - 1) how to write statement

CodePudding user response:

 
- provide you with two kinds of writing

SQL>
SQL> Create table test (name varchar (20));
The Table created
SQL> The begin
2 insert into the test values (' name: zhangsan ');
3 the insert into the test values (' address: Beijing);
4 the end;
5/
PL/SQL procedure successfully completed
SQL> Col name format of a20;
SQL> Col name_1 format of a20;
SQL> Col name_2 format of a20;
SQL> Select the name,
2 substr (name, 1, instr (name, ':') - 1) name_1,
3 regexp_substr (name, '[^ :] +', 1, 1) name_2
4 the from the test;
The NAME NAME_1 NAME_2
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Name: zhangsan name name
Address: Beijing address address
SQL> Drop table test purge;
Table dropped

SQL>

CodePudding user response:

Thank you bosses
Is there a question want to ask you
Sqlsever left (TERM, len (TERM) - 1) & gt; How to write=12 in oracle
  • Related