ho 2 tabelle nel mio db
UTENTE
id
nomeutente
[...]
OFFERTA
id
id_offerente
id_acquirente
oggettovenduto
[...]
ovviamente id_offerente e id_acquirente sono chiavi esterne riferite a UTENTE.id
devo fare un join tra le 2 tabelle in modo che ricercando in base ad "oggettovenduto" mi venga restituita una tabella dove ci siano una campo chiamato "offerente" che contenga UTENTE.username e uno chiamato "acquirente" che contenga anch'esso UTENTE.username
cioè qualcosa del tipo
SELECT * FROM UTENTE, OFFERTA
WHERE (id_offerente = UTENTE.id OR id_acquirente = UTENTE.id) AND oggettovenduto = xxx
e che nn so come creare i 2 campi che mi servono (offerente e acquirente) che nn devono contenere l'id ma l'username :master:
aiutatemi x favore lo so che x voi geni è banale ma io non ci arrivo![]()