MYTABLE:
+-------+-----+-----+
| TITLE | NID | FID |
+-------+-----+-----+
| Test | 1 | 2 |
+-------+-----+-----+
| T2 | 3 | 3 |
+-------+-----+-----+
NODE:
+-----+------+---------+
| NID | TNID | CREATED |
+-----+------+---------+
| 1 | 1 | <date> | (en)
+-----+------+---------+
| 2 | 1 | <date> | (nl)
+-----+------+---------+
| 3 | 4 | <date> | (en)
+-----+------+---------+
| 4 | 4 | <date> | (nl)
+-----+------+---------+
In MYTABLE I save the English NID value, but the problem lies when other languages have to be chosen. The NID value does not match the NID of the NODE table (obviously) and I cannot simply use the TNID value because it is possible people started from another language (as seen where TNID = 4).
My current query:
SELECT m.nid, m.fid, m.title FROM {MYTABLE} INNER JOIN {NODE} on n.nid = m.nid WHERE n.status = 1 ORDER BY n.created DESC;
This works perfectly for the EN version of the website since those are the NID values I store in the MYTABLE table, but doesn't work for other languages. How can I easily fix that, while still beeing able to sort on the creation date of a node.