开发者

Mysql - Join Same Rows with null entries

开发者 https://www.devze.com 2023-02-06 19:54 出处:网络
I have mysql table with format like this Name - Date1 - Date2 After I got result A - NULL - 1 A - 2 - NULL

I have mysql table with format like this

Name - Date1 - Date2

After I got result

A - NULL - 1
A - 2 - NULL

I want to join these results as

A - 2 - 1

How t开发者_如何学Pythono achieve this ?


  SELECT Name,
         MAX(Date1),
         MAX(Date2)
    FROM tbl
GROUP BY Name
0

精彩评论

暂无评论...
验证码 换一张
取 消