NJ_315
NJ_315

Reputation: 1883

How to write a hive query to display all records if one particular record is present?

I have to write a hive query to display a full table if a particular record is present in the table.

For example: I have a table customers ( cust _name,cust_num,city,rating)

I have to display all the records if city San Jose is present in this table. how can i write my query using select statement?

Upvotes: 0

Views: 462

Answers (2)

kgu87
kgu87

Reputation: 2057

You could do this:

    select a.* from customers a 
    inner join customers b on b.city = 'San Jose'

Upvotes: 1

user2265478
user2265478

Reputation: 153

Try this query:

SELECT * FROM customers WHERE city='San Jose'   

Upvotes: 0

Related Questions