Select Distinct Cant Be Done!!!!!!!

K

kennykee

I have three column in a combo box
width is 2 cm ,0 cm ,0cm

the 0cm has other functions

Question: i want to show the value of the first column distinctively, I used
"select distinct" but i still can see a lot of repeating values. The reason
is there are different values in column 2 and column 3. So how to ignore the
column 2 and column 3 but i want them to exist as column 2 and 3?

In short, i want to see different values in column 1 but maintaining the
column 2 and 3

Thanks in advance

Kennykee
 
R

Rick Brandt

kennykee said:
I have three column in a combo box
width is 2 cm ,0 cm ,0cm

the 0cm has other functions

Question: i want to show the value of the first column distinctively,
I used "select distinct" but i still can see a lot of repeating
values. The reason is there are different values in column 2 and
column 3. So how to ignore the column 2 and column 3 but i want them
to exist as column 2 and 3?

In short, i want to see different values in column 1 but maintaining
the column 2 and 3

Thanks in advance

Kennykee

Given sample data of...

1 1 1
1 1 2
1 2 1
1 2 2
2 1 1
2 1 2

...exactly what would you want for output? If you want distinct values on column
1 then you have to decide which rows for the various values of columns 2 and 3
you want to discard. For example...

SELECT Field1, Min(Field2), Min(Field3) GROUP BY Field1

....would produce...

1 1 1
2 1 1

You could substitute most any other aggregate function for Min() and they would
give you only one value for the Group By field.
 
K

kennykee

Thanks Rick
You are right

Rick Brandt said:
Given sample data of...

1 1 1
1 1 2
1 2 1
1 2 2
2 1 1
2 1 2

...exactly what would you want for output? If you want distinct values on column
1 then you have to decide which rows for the various values of columns 2 and 3
you want to discard. For example...

SELECT Field1, Min(Field2), Min(Field3) GROUP BY Field1

....would produce...

1 1 1
2 1 1

You could substitute most any other aggregate function for Min() and they would
give you only one value for the Group By field.
 
Top