0

I have a string column "COL" in MySQL, which can be split in sub-strings. Something as "q;we;rt". The result is found with

select COL from [TABLE]

I also have a select which returns this kind of sub-strings from another tables (the columns have values as "rt", etc.). The problem is I have a query like:

 select [column] from [...]

Let consider the result has 2 rows, as "q" and "rt". I need to create a query which returns all the sub-strings from "COL" which are not found in the previous query, and also the position. In this case, the result is 1 row with 2 columns (column 1 - "we", and column 2 - "2" - position of "we" in "q;we;rt"). Note that the number of sub-strings from "COL" is not fix. And I want to do this without creating any function / stored procedure.

Catalin Vladu
  • 389
  • 1
  • 6
  • 17
  • pls have a look at this question/answer http://stackoverflow.com/questions/17942508/sql-split-values-to-multiple-rows/17942691#17942691 – fthiella Jan 25 '16 at 11:05
  • First answer contains a table for create. I forgot to say I also want to do without creating new tables / views. – Catalin Vladu Jan 25 '16 at 12:36
  • the answer contains a table, but you can see the link provided in the comment, there's a fiddle showing how to do without a table – fthiella Jan 25 '16 at 13:23

0 Answers0