Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select only a group of rows with certain criteria
tinschel_at_yahoo.com wrote:
> we are using Oracle as a metadata repository and we are running into
> the following problem:
>
> we have a table with data as follows:
>
> data_id | group_id
> --------------------
> 100 | 110
> 100 | 111
> 101 | 110
>
> We would like to create a select statement that selects a group of
> data_ids (either '100' or '101' in this example) ONLY if that group
> does not have group_id 111. So in this example only '101' should be
> selected.
>
> Any ideas how to accomplish this in a single query?
>
> Tino
Look into using the WHERE clause and operators like NOT.
Demos at www.psoug.org ... click on Morgan's Library.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Tue Aug 02 2005 - 22:32:51 CDT