Tuesday, November 13, 2007

Insert and by pass unique constraint



col1 is the unique index

insert into table1 (col1,col2)
SELECT 'VALUE1','VALUE2' FROM dual where 'VALUE1' not in (select col1 from table1 where col1='VALUE1')

No comments: