vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have create table table1 (col1 varchar(50)); insert into table1 values ('abc'), ('defg'); create table table2 (col2 varchar(50)); insert into table2 values ('abc d'), ('defg h'), ('abcd'), ('defgh'); And I need those as the result 'abc', 'abc d' 'defg', 'defg h' select col1, col2 from table1 join table2 on ? |
| |||
| DECLARE GLOBAL TEMPORARY TABLE Table1 (Col1 VARCHAR(50)) INSERT INTO SESSION.Table1 VALUES ('abc'), ('defg') DECLARE GLOBAL TEMPORARY TABLE Table2 (Col2 VARCHAR(50)) INSERT INTO SESSION.Table2 values ('abc d'), ('defg h'), ('abcd'), ('defgh') SELECT Col1, Col2 FROM SESSION.Table1, SESSION.Table2 WHERE VARCHAR(Col1 || ' ' || REPLACE(Col2, Col1 || ' ', ''), 50) = Col2 DROP TABLE SESSION.Table1 DROP TABLE SESSION.Table2 COMMIT B. |