Sicuro che la tua soluzione non sia una semplice join?
"SELECT * FROM tabellauno AS ta JOIN tabelladue AS tb ON ta.id=tb.id"
Questa query ti selezionerà tutte le righe delle due tabelle che hanno i campi id identici ad esempio, naturalmente puoi giocarci costruendoti query molto più complicate o subquery
"SELECT * FROM tabella WHERE id = (SELECT num FROM tabelladue WHERE (date + INTERVAL 2 HOUR > NOW())) ORDER BY id DESC" boh![]()

Rispondi quotando