Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > HELP with a que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 15690 of 17437
Post > Topic >>

HELP with a query with blank fields

by tech@[EMAIL PROTECTED] ("J. Manuel Velasco") May 27, 2008 at 08:01 PM

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.


-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 2 Posts in Topic:
HELP with a query with blank fields
tech@[EMAIL PROTECTED] (  2008-05-27 20:01:27 
Re: HELP with a query with blank fields
sszabo@[EMAIL PROTECTED]   2008-06-01 19:41:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 13:07:26 CST 2008.