Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sequence and distinct on a select statement

604840Jul 22 2008 — edited Jul 23 2008
Hi,

I was trying to select a distinct column and insert the result set in a new table with a sequence. Below is the code
insert into tableA values(colA_PK, colA_1)
select colA_PK_sequence.nextval, distinct(colB_1) from tableB where colB_2=xCriteria;
This one throws me a ORA-00936 error. Is it possible to use both the sequence and distinct in the same statement. If Yes, can you please provide me the syntax

Thanks in advance for your help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2008
Added on Jul 22 2008
7 comments
929 views