zioarnold Posted June 11, 2016 Share Posted June 11, 2016 Greetings what's wrong with this script ? SELECT PE.nome_paziente AS Nome, PE.cognome_paziente AS Cognome, PE.indirizzo_paziente AS Indirizzo, PE.data_nascita_paziente AS DataNascita, E.descrizione AS NomeEsame, PE.data_esame AS DataEsame, PE.ora_esame AS OraEsame, U.tipo_urgenza AS NomeUrgenza, O.nome_ospedale AS NomeOpsedale FROM prenota_esame PE, esame E, urgenza U, ospedale O INNER JOIN esame E ON PE.cod_esame = E.id_esame INNER JOIN urgenza U ON PE.cod_urgenza = U.id_urgenza INNER JOIN ospedale O ON PE.cod_ospedale = O.id_ospedale ORDER BY id_prenotazione DESC LIMIT 1; Here below u see the DB Dictionary... Link to comment Share on other sites More sharing options...
zioarnold Posted June 11, 2016 Author Share Posted June 11, 2016 FIXED Thanks! SELECT PE.nome_paziente AS Nome, PE.cognome_paziente AS Cognome, PE.indirizzo_paziente AS Indirizzo, PE.data_nascita_paziente AS DataNascita, E.descrizione AS NomeEsame, PE.data_esame AS DataEsame, PE.ora_esame AS OraEsame, U.tipo_urgenza AS NomeUrgenza, O.nome_ospedale AS NomeOpsedale FROM prenota_esame AS PE LEFT JOIN esame as E ON E.id_esame = PE.cod_esame LEFT JOIN urgenza as U ON U.id_urgenza = PE.cod_urgenza LEFT JOIN ospedale as O ON O.id_ospedale = PE.cod_ospedale ORDER BY id_prenotazione DESC LIMIT 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now