SELECT A.referenceid, B.NOME, B.AVATAR, A.memberid, C.nome, C.AVATAR
FROM AMICIZIE A,
(SELECT UTENTI.id, UTENTI.nome, UTENTI_COM.avatar FROM UTENTI LEFT JOIN UTENTI_COM ON UTENTI.id = UTENTI_COM.id) B,
(SELECT UTENTI.id, UTENTI.nome, UTENTI_COM.avatar FROM UTENTI LEFT JOIN UTENTI_COM ON UTENTI.id = UTENTI_COM.id) C
WHERE A.referenceid = B.id
AND A.memberid=C.ID;
Ciao
Mik
grazie mille dell'aiuto
solo non ho capito l'input dove devo inserirlo:
a me serve selezionare tutti i refecenceid (e relativo nome e avatar) che hanno X memberid (cioè sono amici di memberid).
X deve essere un valore dinamico