Search code examples
sqlhivehiveqlbeeline

Select from list of values on beeline


I use beeline, which is a JDBC client based on SQLLine, to run Hive queries. I would like to select from a liste of values like:

SELECT DISTINCT * FROM (a,b,b,c,d,..z)

is that posssible?


Solution

  • SELECT DISTINCT *
    FROM (
        SELECT 12
        UNION SELECT 23
        UNION SELECT 34
        UNION SELECT 12
        UNION SELECT 23
    ) AS t1;
    

    PS: also refer to very closely related question How can I select from list of values in SQL Server