6
Reply

Insert into table if record don't exist

CHAITANYA KIRAN KASANI

CHAITANYA KIRAN KASANI

May 27 2015 4:51 AM
496
hi,
The below is the sql statement that inserts the record if only the record is not exists in table.. but the statement i written is inserting multiple times the same record... please help me to resolve my problem..
Hide Copy Code
INSERT INTO TableName(AccountNo,Customer,ContactNo) select 'AP1234','Saketh','984822338' FROM TableName WHERE NOT EXISTS(Select * From TableName Where AccountNo='AP1234');

Answers (6)