sql - equivalent of if exists in isqlplus? -
i'm new sql , trying find out if there way in isqlplus? i'm trying insert row values if value exists on table.
if exists (select id sometable id = 1) begin insert anothertable (nbr, fname, lname) values ( 2, 'john', 'smith'); end any appreciated.
you can add where exists in query
insert anothertable (nbr, fname, lname) select 2, 'john', 'smith' dual exists (select id sometable id = 1)
Comments
Post a Comment