Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Using distinct across several columns
Hi
try
select distinct name, street,phone,order_number from table_name;
Alistair
"Steve Wicklund" <savant_7_at_hotmail.com> wrote in message
news:5de96e4e.0301140723.6c9b091f_at_posting.google.com...
> Hello all; I have fiddled with this syntax for a bit now. what is the
> syntax for finding results that are unique across several rows-- but
> not all. E.G.: a table has columns name, phone, street and
> order_number. I want to have all four columns retunred-- but one row
> for every unique combination of name, street and phone.
>
> name street phone order_number
>
> 1) bob Oak st 555-1212 2525
> 2) bob Oak st 555-1212 2521
> 3) fred Oak st 555-1212 2529
> 4) jerry Pine st 555-1212 2522
> 5) bob Oak st 555-1212 2527
> 6) jerry Pine st 402-1212 2560
>
>
> In this case rows 1, 3, 4, and 6 would be returned.
>
> Can this be done? Or is there a better way to pull of getting
> uniqueneess across 'N' number of rows.
> Cheers.
Received on Tue Jan 14 2003 - 09:37:13 CST
![]() |
![]() |