I can't get the excluded values from a table that contains user details!
I have table named users with ID, Name etc,
I have a reluserdata with relid, Id_user this is 1:1 with users table
and another table data that contains relid, id_value_data, description, etc. This is 1:N with reluserdata
So i have users that have the id_value data 10 that stand for Proffession and other that don't have yet a proffession so don't have the field 10! Almost all users have some data fileld!
When i select the id value 10 it return me 250 users from a total of 500 and it's correct but if i exclude the id_value 10 it returns me all 500 and not the remaining 250!
How can i get that?
Thanks to all and if you don't understand my bad english i'll try to explain better!
I dont need to sum or count them! i need to view all the user data in a table, so if i select the id_value 10 it show me only the users that have in the table data(that is many to 1 user) id_value 10. How can i do the same for showing only those who dont have id_value=10 becouse now if i made and excluded selection it show me all of them because an user can have many id_value.
so if i select the user who have id value 10 it gives me Tom so only one
But if i select exclude 10 it gives me all of the beacouse id_value has data!
how can i made to show me only the rest of them: John and Daniel
Don't work, same result!
I can do it in sql but i need something similar in qw
something like that:
FROM Users u
WHERE u.id NOT IN
( SELECT d.user_id
FROM Documents d
WHERE d.value_id =10
Your users and reluserdata are not showing same field name for association, I think id of first table should be 'userid' or other way round.
Also relid 112 is linked to both 10 and 15 id value in last table, thats why it is picked for both 10 and 15. Because both are linked to ID value 1 or 'Tom'.