V
V
Vincent12017-01-09 23:08:52
MySQL
Vincent1, 2017-01-09 23:08:52

How to avoid overwriting data in a LEFT OUTER JOIN column?

The point is very simple. There are 2 tables A and B. I supplement table A with data from B in the % last name column.
If there is no match for %lastname% in table B, then the columns are filled with null, which is normal.
The problem is that also in this case, the %surname% itself is overwritten with null. And as a result, I have a "string" with data where instead of% surname% is null.
How to make column %surname% not overwritten with LEFT OUTER JOIN ?
-------------
You can, of course, specify in SELECT which fields to return, but I would not want to. There are many of them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2017-01-10
@Vincent1

ON p. lastname =pai. lastname Column
names are the same, so only one column is returned. So either rename a column in one of the tables, or list the required fields in a SELECT.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question