db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Clos <mail...@gmx.net>
Subject Re: Join or Where Clause
Date Mon, 06 Dec 2004 19:24:44 GMT
hi Daniel,

i would declare the Foreign Key as unique.

cheers,
Stefan


Daniel Müller schrieb:

>Hello,
>
>I have 2 tables. In one table stand numbers in the secound table stand
>adresses. The have a foreign key
>
>NumberTable
>N_ID
>N_Number
>
>AdressesTable
>A_ID
>A_N_ID
>A_Name
>
>The adresses table have the foreign key A_N_ID=N_ID.
>
>In the number table stand very much numbers. Now i wont to find out what
>numbers in the number table are free, without a relation. I wont to build a
>1:1 relation. For this I need to know what number is not set for a adress. I
>have made this statement:
>
>
>SELECT DISTINCT
>NumberTable.N_ID,
>NumberTable.N_NUMMER,
>FROM
>NumberTable,
>AdressesTable
>WHERE
>AdressesTable.A_N_ID<>NumberTable.N_ID;
>
>This statement works, but how i can create it with torque?
>
>Or is it better if I do it with right joins?
>
>How I do it with joins?
>
>Thanks for help.
>
>Daniel
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message