Thursday, September 15, 2011

Problem List


1) Suppose you have two columns in Excel and one record where one column has value but another column has nothing. Now you are going to paste this record into a Access database table where also has two columns. Now you want to delete this record by SQL statement. How you do it? Condition is you also supply the value of Second column in where condition of Delete statement.


Ans:  Wrong Answer: delete <tablename> where Column1='<value>' and Column2='';
                                  delete <tablename> where Column1='<value>' and Column2=null;

          Right Answer:  delete <tablename> where Column1='<value>' and Column2 is null;

No comments:

Post a Comment