Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Hive-Hive case statement with And condition
Labels:
- Labels:
-
Apache Hive
New Contributor
Created ‎04-28-2020 03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to use And condition in a case statement but it is not considering 2nd condition while executing.
Example:
select
case when a =1 and b =2
then
"Data received"
END
Please let me know can we use And statement in case or not?
1 REPLY 1
Master Collaborator
Created on ‎04-29-2020 01:54 PM - edited ‎04-29-2020 01:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just ran the following query through Hive and it worked as expected.
select
col1,
col2,
case when col1 = "Female" and col2 = "Yes" then "Data Received" end
from table_name limit 100;
Can you provide some steps to reproduce?
