Different SQL Delete Statement -


i have table 'department' inside database , delete rows. ask if

the result of sql delete code:

delete itd department itd itd.departmentid = 1 

is same result of this:

delete department  departmentid = 1 

does both codes delete entry in table?

the both same. first optional.

in short, use syntax 1 specify table data has deleted if condition deleting data involves using 2 tables.

delete t1     exists (    select t2.some_id      t2     t2.some_id = t1.some_id ); 

this can written

delete t1  t1, t2 t1.some_id = t2.some_id; 

hope clear now. more information see msdn link


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -