php - How to replace null with the value of other fields in database table
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-18 10:45:16
0
2
742

There are two fields A in the data table class, field B
All of the fields in field A contain data, and some of the fields in field B contain data and some are NULL

Such as
A B
10 2
15 7
9 Null
16 8
7 Null
11 Null

How to make field B equal to the data of field A if it is NULL
That is to achieve the following effect
A B
10 2
15 7
9 9
16 8
7 7
11 11

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
迷茫

IF(expr1,expr2,expr3)
IFNULL(expr1,expr2)
case when
Link description

为情所困

ifnull(B,A)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template