Skip to content
Advertisement

How do I replace blank spaces with null values and query where values are not null? (I’m filling in a table)

I have two tables:

table1:

USER_NUM FIRST_NAME LAST_NAME
A123 Billy Bob
A124 Billy Joe
Jane Doe
John Doe

I am trying to insert FIRST_NAME and LAST_NAME under USER_NAME into table2:

OWNER_ID USER_NUM USER_NAME
111 A123
112 A124

Using this query:

The problem is, if I isolate my select statement I still get blank values for USER_NUM with a table looking like this:

USER_NUM USER_NAME
A123 Billy Bob
A124 Billy Joe
Jane Doe
John Doe

and I get an error saying I can’t insert null values into my table.

How do I get rid of these blank values in USER_NUM?

Advertisement

Answer

You want update:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement