How to connect two query results?
- by nijansen
I want to retrieve all ids within a certain timespan. The timestamps however,
are stored in a different table:
Table A has column my_id
Table B has columns my_id, timestamp
I would want something like
SELECT
id,
time
FROM
(SELECT my_id AS id FROM A) q1,
(SELECT timestamp AS time FROM B WHERE my_id = id) q2
;
But how can I get the value of id within a different subquery? Is there
an elegant solution for this problem?