+----------+----------+-----------------------+-----------------------------+
| Coloumn1 | Coloumn2 | Coloumn3 | coloumn4 |
+----------+----------+-----------------------+-----------------------------+
| NULL | AAAA | NOTICE | Plaintiffs Notice of Filing |
| NULL | AAAB | NOTICE CANCEL HEARING | Plaintiffs Notice of Filing |
+----------+----------+-----------------------+-----------------------------+
I have this table and I want to get distinct value from coloumn4.
I also need the Coloumn2 data for the first corresponding column 4 data. For example, row 1 and 2 have same data in coloumn4. So on applying query I need data like:
Coloumn2 | Coloumn4
---------|----------------------------
AAAA | Plaintiffs Notice of Filing
What is the SQL query to get this data?
SQLFiddle Demo