Reputation: 460
I have the following table:
inventor(inventorID, PatentNo, InventorFirst, InventorLast, City, State)
where inventorid is pk, patentno is fk.
This is the current insert code:
insert into Inventor (PatentNo, InventorFirst, InventorLast, City, statename, country, NationalityCountry, ResidenceCountry)
select PatentNo, InventorFirstname, InventorLastname, City, statename, country, NationalityCountry, ResidenceCountry
from InventorUpdate;
I want to modify this so that if InventorFirstname & InventorLastname fields are blank then it does not insert into the inventor table
Upvotes: 0
Views: 4302
Reputation: 13132
How about you keep the records where those fields are null from being selected?
insert into Inventor (PatentNo, InventorFirst, InventorLast, City, statename, country, NationalityCountry, ResidenceCountry)
select PatentNo, InventorFirstname, InventorLastname, City, statename, country, NationalityCountry, ResidenceCountry
from InventorUpdate
Where InventorFirstname is not null
And InventorLastname is not null;
Upvotes: 5