Search Postgresql Archives

HELP with a query with blank fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

This is the current query I have:

SELECT dominis.nom, dominis.extensio, dominis.creat, dominis.expira,
titulars.first_name, titulars.last_name, contactes_admin_tec.first_name,
contactes_admin_tec.last_name, dns1.nom, dns2.nom, dominis.redirec,
contactes_fac.nom, grups.nom FROM dominis, contactes_fac, dns as dns1,
dns as dns2, titulars, contactes_admin_tec, grups WHERE
dominis.id_c_f=contactes_fac.id AND dominis.id_dns1=dns1.id AND
dominis.id_dns2=dns2.id AND dominis.id_titular=titulars.id AND
dominis.id_c_a=contactes_admin_tec.id AND contactes_fac.id_grup=grups.id
AND dominis.id_c_f = 724

The problem is that are registers that has not dominis.id_dns2 value and
then they are not extracted. I need to show also these ones.

I try playing with inner join, left join,... but I get this error:

ERROR:  referencia invalidad a una entrada de clausula FROM para la
tabla "dominis"
LINE 9: ON dominis.id_dns2 = dns2.id
           ^
HINT:  Hay una entrada para la tabla "dominis", pero este no puede ser
referenciado desde esta parte de la consulta.

Free translation: Invalid reference in FROM clausule. There is an entry
in table dominis but it can't referenced from this part of the query.

I also tried changing
dominis.id_dns2=dns2.id by (dominis.id_dns2=dns2.id or dominis.id_dns2
is null) 
but it's wrong, i get more than one record of the field from the
register there is an empty value in id_dns2 field.

Can anybody help to achieve the goal? I really will appreciate.

Thanks in advance.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux