Home > database >  Commas in the field is how to how to remove the associated query respectively?
Commas in the field is how to how to remove the associated query respectively?

Time:09-20

table as shown in figure, A  B table as shown in figure, now need to put the AB field, according to the corresponding conversion table B Chinese impression in the CONNECT BY can, write several times have failed, please take A look at how to write SQL? thank you

CodePudding user response:

Two tables of data, give some example, to insert in the form of,

CodePudding user response:

This problem is simpler, please give predicate sentence and test data,

CodePudding user response:

Thank you two reply, test data as follows,
/* 
Drop table T1;
Drop table T2;
*/
The CREATE TABLE T1 (
LX VARCHAR2 (10),
DM VARCHAR2 (20),
QX VARCHAR2 (3000)
);
Insert into T1 values (' CK07 ', 'c512', 'the about, accept, cancel, controlg, controlp, controlr, exit, help, locale, qbe_save, qbe_select');
Insert into T1 values (' CK07 ', 'mp002', 'the about, accept, cancel, close, controlg, controlp, controlr, exit, help, locale, qbe_save, qbe_select');
Insert into T1 values (' CK08 ', 'mp306', 'the about, accept, cancel, controlg, controlp, controlr, controls, execute, exit, give_up, help, locale, qbe_save, qbe_select, select_cancel');
Insert into T1 values (' CK08 ', 'mp700', 'the about, accept, cancel, controlg, controlp, controlr, exit, help, locale, mntn_doc_pty');
Insert into T1 values (' CK09 ', 'mp702', 'the about, accept, cancel, controlg, controlp, controlr, exit, help, locale, mntn_reason');

The CREATE TABLE T2 (
The AN VARCHAR2 (80),
BZ VARCHAR2 (20),
ZW VARCHAR2 (80)
);
Insert into T2 values (' about ', 'standard', 'information');
Insert into T2 values (' accept ', 'standard', 'sure update');
Insert into T2 values (' cancel ', 'standard', 'cancel');
Insert into T2 values (' close ', 'mp002', ');
Insert into T2 values (' close ', 'standard', 'leave').
Insert into T2 values (' exit ', 'standard', 'end');
Insert into T2 values (' give_up ', 'standard', 'give up');
Insert into T2 values (' help ', 'standard', 'help');
Insert into T2 values (' jump ', 'standard', 'specified pen');
Insert into T2 values (' last ', 'standard', 'at the end of a');
Insert into T2 values (' locale ', 'c512', 'simple input);
Insert into T2 values (' locale ', 'standard', 'language');
Insert into T2 values (' qbe_save ', 'standard', 'condition of storage).


Demand from T1 QX on T2 table AN zw AND condition IS when the T1 DM=T2. BZ AND T2. Zw IS NOT NULL, or standard corresponding to T2 numerous English, according to or
The desired results are as follows:
CK08 mp306 program information, determine the update, cancel, query that open a window, open the query window, the necessary field, end, help, simple input, language, query condition storage,

CodePudding user response:

 
That split

As with m (
The select LX, DM, regexp_substr (QX, '[^,] +' 1, level) new_item
The from t1 connect by level & lt;=regexp_count (qx, ', ') + 1
And the prior rowid=rowid
Value is not null and the prior dbms_random.
)
Select * from m

CodePudding user response:

That's great, thank you very much

CodePudding user response:

The results confirm that is correct, please post
  • Related