RATE THIS ANSWER
0
Click to Vote:
0
0
I'm sorry but, what is the a question?
Phil
What I have done is developed a little example. Each example is in the same query. Example 1 is one that I can use. The second one is one that I need know of. The case is I need to be able to develop a query that will look at each of the number columns (Column2 & 3). If Column 1 is the same I want to keep the list. if column 1 is made up of different listing I need to receive a list or a query showing these groups. I need to know all the listing that would show column 1 as different and the column 3 would be the same based on the query above. The [ ] show the original fields.
Query ACD
Example 1
Column 1 Column2 Column 3
-----------------------------------------------------------------------------
Toy Car 2347AB 8753RT
Toy Car 5432AC 8753RT
Toy Car 6748MR 8753RT
----------------------------------------------------------------------------
Example 2
Column 1 Column2 Column 3
Toy Car 1588AB 1254ED
Toy Truck 5971AC 1254ED
Toy Sub 1472MR 1254ED
--------------------------------------------------------------------------------
Solving this for your original query .. ohhhhh what a headache but if you materialized that query
by inserting it into a new temorary file..then solving it for this issue seperately ...
I'm going to call the data with the examples above myFile and the columns Col1, Col2, Col3
and I'll join it to itself
Select 1 using <
Select a.Col1, a,col2, a.col3, b.col1, b.col2, b.col3
from myfile.a join myfile.b
on a.col3 = b.col3 and a.col1 < b.col1
a.Col1 a.Col2 aCol3 b.Col1 b.Col2 b.Col3
------------------------------------------------------
Toy Car 1588AB 1254ED Toy Truck 5971AC 1254ED
Toy Car 1588AB 1254ED Toy Sub 1472MR 1254ED
Toy Truck 5971AC 1254ED Toy Sub 1472MR 1254ED
or
Select 2 using <>
Select a.Col1, a,col2, a.col3, b.col1, b.col2, b.col3
from myfile.a join myfile.b
on a.col3 = b.col3 and a.col1 <> b.col1
a.Col1 a.Col2 aCol3 b.Col1 b.Col2 b.Col3
------------------------------------------------------
Toy Car 1588AB 1254ED Toy Truck 5971AC 1254ED
Toy Car 1588AB 1254ED Toy Sub 1472MR 1254ED
Toy Truck 5971AC 1254ED Toy Car 1588AB 1254ED
Toy Truck 5971AC 1254ED Toy Sub 1472MR 1254ED
Toy Sub 1472MR 1254ED Toy Car 1588AB 1254ED
Toy Sub 1472MR 1254ED Toy Truck 5971AC 1254ED
or
Select 3 Column3 appears more than once.
Select Col1, col2, col3
from myFile
where col3 in
( select col3 from myFile group by col3 having count(*) > 1 )
Col1 Col2 Col3
----------------------------
Toy Car 1588AB 1254ED
Toy Truck 5971AC 1254ED
Toy Sub 1472MR 1254ED
Don't know if any of these help...
Phil
Last Answered:
Oct 13 2009 5:29 PM GMT by Philpl1jb 
24600 pts.
Latest Contributors: CompEng
600 pts.