sql - How to add null value in where clause (comparison) -
Here's my table sample.
ID name grade sign 1 pinky one tap 2 smita b sam After adding a new record in the sample table after name, grade and sign in Want to If these combinations are not found, insert and do not enter.
from the sample to declare @ number int @ count = count (*) where name = @name and grade = @grade and sign = @ sign - @ name, @ grade and @ sign input paragraph If (0 count = 0) start - insert termination When I'm trying to add the first record which is Pinky, 'A' and is empty. They count as zero and add records. How can it be handled in my table or value of null value? I know that comparison is being done with zero, always false. (null = null) Hello friends, Thanks for ur help. I have tried the following code.
Select from the sample @ count = count (*) where name = @name and grade = @ grid and (sign = @ sign or sign (sign and sign in) But this does not work. It lets me count as zero instead of 1.
I also liked it. I worked when I first Try to add a record which is calculated as Pinky, A and Blank 1. Get me to add further.
From the sample Select count = count (*) where name = @name and grade = @grade and (sign in = NULL or sign = @ sign in) but when unsuccessful I am trying to add a new column, in which the 'Smita', 'B', is empty, it was given to me as a count, but this is wrong, there is no existence for these combinations < P> Once again the ur query was checked @ Mukund
Comments
Post a Comment