- or download this
from table a join table b on -- the primary key
where a.idNumber = b.idNumber
- or download this
select abs(a.price - b.price) as difference
- or download this
where a.date = (select max(Date) from table t1
where t1.idNumber = a.idNumber)
and
b.Date = (select max(Date) from table t2
where t2.idNumber = b.idNumber)
- or download this
select
a.idNumber -- Presuming you want
...
where t1.idNumber = a.idNumber)
and b.Date = (select max(Date) from table t2
where t2.idNumber = b.idNumber)