|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
You will have to forgive me I am new to this, but I want to be able to do a select distinct based on ID number, but display all information from the table just not the duplicate entries. This is what I have but obiviously doesn't work.
select * from emp where id = (select distinct id from emp) order by last_name Cann someone help the new guy out? THanks in advance |
|
#2
|
||||
|
||||
|
Posting the table structure could help ...
One thing: if "select distinct id from emp" returns more than one value you should use "select * from emp where id IN (select distinct id from emp) order by last_name" |
|
#3
|
|||
|
|||
|
SELECT DISTINCT id, field1, field2, field3, field4
FROM table GROUP BY id ORDER BY last_name |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Select distinct but how to display all info |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|