How to INSERT data into a specific column without NULLs in the other columns?

UPDATE table1
SET col2 = dataB2, col3 = dataC2
WHERE col1 = dataA2;

This may serve your purpose.


You will have to use the UPDATE statement if you want to add data to an existing row. Like this for example:

UPDATE table1 SET
col2 = 'data5'
col3 = 'data6'
FROM table1
WHERE col1 = 'data4'

Also it does look like the root of your problem is poor database design, but this query is just to show you how to add data to an existing row.


I found the solution (a chain of logical operations):

1) CHECK if there is a cell (in the target column) with values either "" or NULL.

2) IF it has one of those then rewrite the FIRST one keeping the values of the other cells in this row at their places (assumably we use UPDATE))) ).

3) ELSE just add a new row with all NULLs in the other cell in the row.

If we want to add a few values into various columns simultaneously we may prepare our queries for all of those and then execute them simultaneously (sorry for tautology).

If we need to add a few values into the same column within one query we can prepare it, using loops (repeating paragraphs 1 and 2 (or, optionally, 3).