If i'm not wrong, u can use distinct for the deptno in the select query, this also avoids duplicates . but the thing is u've to specify the distinct only for one column and should be the first column in the select clause.
Hi, break on ... is a command of SQL*Plus and has nothing to do with SQL.
You cannot suppress duplicate values in a resultset of a single SQL query.
Ales
I do not understand what you want.
First possibility:Yes, distinct will return distinct values of the entire result set, you are right. But you want only once dept. no, and combined with another columns in some result set. Logically, if you will not restrict some way the other combination in the result set, you have to have more that one row for one value of dept.no.
Now think: you could use group by deptno. But, because the group by was very logically thinked, you will have to put in your group by list all the columns in select_list that are not agregates or constants. This is very logically stated! This is how the truth comes to the light.
You want once every deptno, but with which values of employee etc.?
Then, the other possible thread: you want all the values, but you want to display deptno only once. Then, this is a client issue. Solve in client or in sqlplus.
Bookmarks