Perry
Perry

Reputation: 35

Mysql - Join Same Rows with null entries

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 to achieve this ?

Upvotes: 0

Views: 73

Answers (1)

zerkms
zerkms

Reputation: 254916

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

Upvotes: 1

Related Questions