How can I use all the selected values of a column, one by one, in another query? Use column values returned from the statement below:

SELECT DISTINCT(column_name) FROM Table1;


into the following query:

SELECT dif_col_1, 
       dif_col_2 
  FROM Table2 
 WHERE key_in_table = (SELECT key_in_table 
                         FROM Table3 
                        WHERE UPPER(some_column) LIKE '%each_value_from_the_first_query%');
Let's start from the inner query and work our way out. You want to return rows from Table3 for which a column matches (using the LIKE operator) any column from Table1, right? I would use the EXISTS operator for that. We can reword your problem as "return all rows from table3 for which there exists at least one matching row from Table1". Here's one implementation:

SELECT key_in_table 
FROM Table3 
WHERE EXISTS
(    
    SELECT 1
    FROM Table1
    WHERE UPPER(Table3.some_column) LIKE '%' || Table1.column_name || '%'
);


You can run that query separately so you can be satisfied that it returns the results that you're after. The final query is as simple as integrating that subquery into what you already had:

SELECT dif_col_1, dif_col_2
FROM Table2 
WHERE key_in_table = 
(
    SELECT key_in_table 
    FROM Table3 
    WHERE EXISTS
    (    
        SELECT 1
        FROM Table1
        WHERE UPPER(Table3.some_column) LIKE '%' || Table1.column_name || '%'
    )
);