-1

I'm trying to delete specific records from a table using where clause but unable to do so. The command executes successfully but says zeros rows are modified.enter image description here

enter image description here

I'm still in the starting stage of learning SQL. Thanks for helping out

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786

2 Answers2

1

= NULL never returns true -- almost all comparisons with NULL return NULL, which is treated as false. The correct logic is IS NULL:

delete from Patient
    where PatientCountry is null
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
1

If you want find or delete null values then dont use "=" but "is". It should be:

delete from patient where patientcountry is null; 
Grzegorz Grabek
  • 960
  • 7
  • 16