Is it possible to use MySQL dynamically to achieve something like the following:
SELECT DISTINCT x FROM ('aaa', 'bbb', 'aaa', 'ccc') x;
where the part 'aaa', 'bbb', 'aaa', 'ccc'
represents a comma separated list of 1000000 values (not table names, not column names) (sorry for confusion).
So all I can do is copy and paste this comma separated list.
I cannot wrap UNIONs around all values.
Expected output:
x
------
aaa
bbb
ccc
Why not use command line tools?
I like MySQL for its syntax on how to manipulate data, GROUPING, SORTING, ... MySQL is the best and easiest to handle datasets.
Again:
A list is defined as:
'aaaa',
'bbbbb',
'aabb',
'ffff',
'dfdff',
'aabb',
'ddsss'
[+ 1000 of those lines]
Now I want to copy and paste this list and do MySQL operations to it. Example:
SELECT DISTINCT [paste list here];
Or:
SELECT * FROM [paste list here] WHERE value LIKE 'aaa%'