Title: RE: [Q] SQLPLUS help on "distinct"

Mike,

Try one of these:

select distinct (rpad(employee_id,6,' ')) ||';'|| ssn
from EMP
order by (rpad(employee_id,6,' ')) ||';'|| ssn;

       or

select distinct employee_id, (rpad(employee_id,6,' ')) ||';'|| ssn
from EMP
order by employee_id;


Jerry Whittle
ASIFICS DBA
NCI Information Systems Inc.
[EMAIL PROTECTED]
618-622-4145

    -----Original Message-----
    From:   mike mon [SMTP:[EMAIL PROTECTED]

    I have problem to use "distinct" with Function on
    select statement.  Can anyone give me a hint?

    Thanks.

    SQL> select distinct (rpad(employee_id,6,' ')) ||';'||
    ssn from EMP
      2  order by employee_id;
    select distinct (rpad(employee_id,6,' ')) ||';'|| ssn
    from EMP
                          *
    ERROR at line 1:
    ORA-01791: not a SELECTed _expression_

Reply via email to