I have the following table
Table: Times
timeid time
1 10
2 11
3 3
Table: Counts
countId timeID numberCounts times
1 1 1 0
2 2 3 11
2 2 3 12
3 2 3 13
4 3 1 0
Query I’m using
SELECT
t.time AS "Start Channel",
c.times AS Lapse
FROM Times t
JOIN Count c ON c.Time_ID=t.Time_ID;
Output
+---------------+----------+
| Start Time | lapse |
+---------------+----------+
| 10 | 0 |
| 11 | 11 |
| 11 | 12 |
| 11 | 13 |
| 3 | 0 |
+---------------+----------+
Desire Result:
+---------------+
| TimeS |
+---------------+
| 10 |
| 11 |
| 12 |
| 13 |
| 3 |
+---------------+
From your desired result, it seems like you want:
but the title of your question makes it sound like you want:
(which would also include a
0in the results, sinceCount.timesis sometimes0).