Re: How to find values which do not return any tuple in "IN" clause

2011-06-11 Thread Claudio Nanni
Sorry but my mail was in "sending state" since last night, and only now was sent. Ignore it. Claudio 2011/6/11 Claudio Nanni > Hi Fahim, > > Could you please explain better what you mean exactly? > I think the question is not very clear. > Thanks > > Claudio > On Jun 11, 2011 12:36 AM, "Fahim

Re: How to find values which do not return any tuple in "IN" clause

2011-06-11 Thread Claudio Nanni
Hi Fahim, Could you please explain better what you mean exactly? I think the question is not very clear. Thanks Claudio On Jun 11, 2011 12:36 AM, "Fahim Mohammad" wrote: > Hi > > select * from tablename where fieldname in ('aaa','bbb','ccc','ddd'); > > return only the successful hit. > > How can

Re: How to find values which do not return any tuple in "IN" clause

2011-06-10 Thread Nuno Tavares
Fahim, I was not quite sure I understood you question, but looking at what you're trying to achieve in this example, give a try to my suggestion. You have to bear in mind that you can only GROUP BY values that indeed show up in the results. That means that if ('','y') never show up, they

Re: How to find values which do not return any tuple in "IN" clause

2011-06-10 Thread Fahim Mohammad
Thank you all for prompt reply. I think there is no short cut and I may need to write nested query for doing this. The method suggested by you is not working. mysql> select * from city; +-+- +--+ | city_id | city_name| state_id | +-+- +

Re: How to find values which do not return any tuple in "IN" clause

2011-06-10 Thread Nuno Tavares
create table dim (value varchar(10), primary key(value)); insert into dim values ('aaa'),('bbb'),('ccc'),('ddd'); SELECT tablename.fieldname FROM dim LEFT JOIN tablename ON tablename.fieldname = dim WHERE tablename.fieldname IS NULL; If this is not what intended, I'd suggest you to spend a littl

Re: How to find values which do not return any tuple in "IN" clause

2011-06-10 Thread Fahim Mohammad
I am looking for those values (or count of those values) which do not resulted in a hit. Thanks Fahim On Fri, Jun 10, 2011 at 7:17 PM, Fayaz Yusuf Khan wrote: > On Saturday 11 Jun 2011 4:06:27 AM Fahim Mohammad wrote: > > select * from tablename where fieldname in ('aaa','bbb','ccc','ddd'); > >

Re: How to find values which do not return any tuple in "IN" clause

2011-06-10 Thread Fayaz Yusuf Khan
On Saturday 11 Jun 2011 4:06:27 AM Fahim Mohammad wrote: > select * from tablename where fieldname in ('aaa','bbb','ccc','ddd'); > How can I know how many out of four ('aaa','bbb','ccc','ddd') resulted in a > miss OR which values do not return any tuple. Perhaps this would be what you're looking

How to find values which do not return any tuple in "IN" clause

2011-06-10 Thread Fahim Mohammad
Hi select * from tablename where fieldname in ('aaa','bbb','ccc','ddd'); return only the successful hit. How can I know how many out of four ('aaa','bbb','ccc','ddd') resulted in a miss OR which values do not return any tuple. Thanks Fahim