Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Silly SQL Question

RE: Silly SQL Question

From: Gabriel Aragon <gabriel_gap_at_yahoo.com>
Date: Mon, 17 Nov 2003 14:54:25 -0800
Message-ID: <F001.005D6F54.20031117145425@fatcity.com>


Ok, guys I have to apologize twice,

First: the delay to answer your very kind emails, (you know the urgent problems dont let you time for the important ones)

Second: maybe my question was not clear enough, ciertanly what Bambi says is what I need "give me all the usrs where there exists a record containing 1 AND 5 AND 7", the criteria was the list, not the records, so it does not matter if the user has many more records, but if he/she has those records that are in the list, that is what I want, the solution is as simple as Bambi's query.

I really really appreciate all the solutions provided for you guys, I swear I tested every one.

Below I have a copy of my original email.

Thank you very much!
Gabriel Aragon

+++++++++++++++++++++++++++++++++++++++++++
I have a table like this:

Usr val



GAP 1
GAP 5
GAP 7
JKL 8
JKL 5 I need a query that returns the user (GAP o JKL) that has ALL the values in a list. Example: Having the list: 1,5,7 the result will be GAP, but with the values 1,5 or 1,5,7,8 there will be no result.

select distinct usr from xxx
where val = All (1,3,5)

I was trying the ALL operator but it works with part of the list, I need the user that has (exactly) all the values in the list. Any idea?

Maybe it's a simple solution, but after several hours I feel blocked.

Gabriel

+++++++++++++++++++++++++++++++++++++++++++



"Any dream worth having is a dream worth fighting for"(Cualquier sueño que valga la pena tener, es un sueño por el que vale la pena luchar)Charles Xavier

Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Gabriel Aragon
  INET: gabriel_gap_at_yahoo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon Nov 17 2003 - 16:54:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US