I have table like this. From this i want the customer name who missed his last 3 appointments(Means his last 3 visit date is null).
+---------+------------------------+------------------------+
|Customer |appointmentDate |Vstdate |
+---------+------------------------+------------------------+
|a |2017-01-01 00:00:00.000 |2017-01-01 10:42:33.793 |
|a |2017-01-30 17:40:00.000 |NULL |
|a |2017-01-30 17:40:00.000 |2017-01-30 19:52:39.000 |
|a |2017-02-01 20:50:00.000 |2017-02-01 17:37:12.000 |
|a |2013-02-14 12:20:59.407 |NULL |
|b |2017-03-02 00:00:00.000 |2017-03-02 13:17:13.000 |
|b |2017-03-25 12:30:00.000 |2017-03-25 14:30:00.000 |
|b |2017-04-23 10:20:00.000 |NULL |
|b |2017-05-27 12:30:00.000 |NULL |
|b |2017-10-01 00:00:00.000 |NULL |
|c |2017-03-02 00:00:00.000 |2017-03-02 13:17:13.000 |
|c |2017-01-01 00:00:00.000 |2017-01-01 10:42:33.793 |
|c |2017-01-30 17:40:00.000 |NULL |
|c |2017-01-30 17:40:00.000 |2017-01-30 19:52:39.000 |
+---------+------------------------+------------------------+
For example from the above table only the customer b has missed his last 3 appointments(Means his last 3 visit date is null). I want only his name to be retried from the table.