I have a table "appointments" in MySQL:
+----+---------+--------+------------+----------+-------+---------+
| id | doctor | sugery | date | time | avail | patient |
+----+---------+--------+------------+----------+-------+---------+
| 1 | DR10001 | 1 | 2003-04-05 | 09:20:00 | 0 | PT15931 |
| 2 | DR10001 | 1 | 2003-04-06 | 10:00:00 | 1 | |
| 3 | DR10001 | 1 | 2003-04-06 | 10:10:00 | 1 | |
| 4 | DR10001 | 1 | 2003-04-08 | 10:10:00 | 0 | PT15000 |
+----+---------+--------+------------+----------+-------+---------+
all i need is to get a count of the number of unique different dates past a given date for an example 2003-04-05
in this case it should give COUNT as 2 for 6th and 8th
could someone please quickly run though the statement.
Many thanks for your help in advance!
+----+---------+--------+------------+----------+-------+---------+
| id | doctor | sugery | date | time | avail | patient |
+----+---------+--------+------------+----------+-------+---------+
| 1 | DR10001 | 1 | 2003-04-05 | 09:20:00 | 0 | PT15931 |
| 2 | DR10001 | 1 | 2003-04-06 | 10:00:00 | 1 | |
| 3 | DR10001 | 1 | 2003-04-06 | 10:10:00 | 1 | |
| 4 | DR10001 | 1 | 2003-04-08 | 10:10:00 | 0 | PT15000 |
+----+---------+--------+------------+----------+-------+---------+
all i need is to get a count of the number of unique different dates past a given date for an example 2003-04-05
in this case it should give COUNT as 2 for 6th and 8th
could someone please quickly run though the statement.
Many thanks for your help in advance!