Nice and clever!
Stepping up a little bit, the input is
"xyz abc pqr", i use a pipelined function to convert row to columns :
SELECT
COLUMN_VALUE
FROM
TABLE(convert_string_to_table(p_string => 'xyz abc pqr', delimiter => ' '))
i get:
----
xyz
abc
pqr
always (?) displayed in this order, how the pipelined function processed the input.
I can easily add a "rownum" for this set, so i get:
SELECT
COLUMN_VALUE word, rownum word_priority
FROM
TABLE(convert_string_to_table(p_string => 'xyz abc pqr', delimiter => ' '))
and get:
-----
xyz 1
abc 2
pqr 3
But.. how to do a "MINUS", as the second set would not have the same rownum
SELECT
COLUMN_VALUE word, rownum word_priority
FROM
TABLE(convert_string_to_table(p_string => 'xyz abc pqr', delimiter => ' '))
MINUS
SELECT 'pqr' , rownum --this # is always dynamic, so it won't get eliminated from the first set .. ?
FROM dual;
Thanks,