hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hamilton, Robert (Austin)" <robert.hamil...@hp.com>
Subject RE: Simple Hive Query
Date Tue, 06 Mar 2012 00:11:55 GMT
Hi Vikas. You might review your logic. You probably want 'and' instead of 'or' in your where
clause.

From: hadoop hive [mailto:hadoophive@gmail.com]
Sent: Monday, March 05, 2012 5:55 AM
To: dev@hive.apache.org; user@hive.apache.org
Subject: Simple Hive Query

Hi Folks ,

i m facing a problem like i have a table a(k1 int ,k2 int ,k3 int   );

and data present is like

*9,*1,*3
3,4,5
12,32,54
*9,12,32
12,*9,21

i need row which doesn't have *9 in any fields.

i wrote a query

1: select k1,k2,k3 from a where (k1<>'\*9' or k2<>'\*9' or k3<>'\*9');

2: select k1,k2,k3 from a where (k1<>'*9' or k2<>'*9' or k3<>'*9');

3: select k1,k2,k3 from a where (k1<>"*9" or k2<>"*9" or k3<>"*9");

any of these case is not working.

i need the result like

*9,*1,*3
3,4,5
12,32,54
*9,12,32
12,*9,21


Thanks
Vikas Srivastava

Mime
View raw message