I think Distinct will only help If I have multiple records that are the same, which I do not have in this case. I am trying to retrieve data from one table that is not already in the other table.
Example if locations were cookies.
If User1 already has a snickerdoodle and an oreo(Table 2), and there are only 3 types of cookies to choose from, then the only selection I would want in the dropdownlist is Chocolate chip(Table 1)
this is for security permissions to edit data for users and location info, but only at certain locations. So if a client has 10 locations, but you only want the manager of office a to be able to update info for people at office a, and not b,c,d... but if
you have a district manager who is in charge of 5 offices, then you would want him to be able to edit data for those 5 offices. Now if you give him 10 offices, and he is already in charge of 5, then I do not want the person to be able to select the 5 he already
has since this would cause duplicate records. In that case I could use distinct, but my database could be full of duplicate records which would not be data friendly if you have 1000 clients and 10,000 records but only really use 4000 because the rest are duplicate.
"Success is the Sum of Small Efforts, Repeated Day in and Day Out - Without Ceasing!"
Currently Learning: ASP, SQL, CSS, JavaScript, AJAX, XML, XSLT, C# So please be patient with me! Thanks
Bobby-Z
Contributor
2864 Points
1125 Posts
Re: NEED HELP WITH QUERY
Apr 19, 2012 06:17 AM|LINK
I think Distinct will only help If I have multiple records that are the same, which I do not have in this case. I am trying to retrieve data from one table that is not already in the other table.
Example if locations were cookies.
If User1 already has a snickerdoodle and an oreo(Table 2), and there are only 3 types of cookies to choose from, then the only selection I would want in the dropdownlist is Chocolate chip(Table 1)
this is for security permissions to edit data for users and location info, but only at certain locations. So if a client has 10 locations, but you only want the manager of office a to be able to update info for people at office a, and not b,c,d... but if you have a district manager who is in charge of 5 offices, then you would want him to be able to edit data for those 5 offices. Now if you give him 10 offices, and he is already in charge of 5, then I do not want the person to be able to select the 5 he already has since this would cause duplicate records. In that case I could use distinct, but my database could be full of duplicate records which would not be data friendly if you have 1000 clients and 10,000 records but only really use 4000 because the rest are duplicate.
Currently Learning: ASP, SQL, CSS, JavaScript, AJAX, XML, XSLT, C# So please be patient with me! Thanks