473,513 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible (if so , how) to filter out Distinct values from a Query that uses two

1 New Member
HI,


I've got a little question regarding SSReportingServices,

I am trying to build a report using 3 different tables , say : Computer , CoWorkers, Harddrive,

In the query I took the "Computer" table 2 times , Coworkers and Harddrive (Computer 2 times because if I only use one and join it with CoWorkers and Harddrive I loose certain values that aren't on the Harddrive Table , so I am joining Computer with Coworkers and than Coworkers with Computer_1 and the latter with Harddrive)


The problem I have is that as a result I am getting Twice the values from the Computer Table Each time , and therefore needed to know , if there was a possible way for me to filter out distinct values.


Thnx in Advance

Query :

SELECT DISTINCT
Computer.Modell, Computer.Name, Computer.antivir, Computer.LastUpdate, Coworker.Login, Harddrive.Status,
Harddrive.LastOnline

FROM Computer INNER JOIN
Coworker ON Computer.CoworkerID = Coworker.ID INNER JOIN
Computer AS Computer_1 ON Coworker.ID = Computer_1.CoworkerID INNER JOIN
Harddrive ON Computer_1.ComputerID = Harddrive.ComputerID
Apr 26 '12 #1
1 1515
ck9663
2,878 Recognized Expert Specialist
I don't think you need to double-join coworker and computer. You're not even using any column from computer_1.

That could be one of the reason why you have duplicate. If you think you're missing some rows, it could be that your JOIN is INNER, not LEFT.

Happy Coding!!!


~~ CK
Apr 26 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1621
by: crispywafers | last post by:
Hi, Is it possible to filter ontop of the current filter being applied to records? This seems like it should be easy? I have two drop down boxes-- one to filter on a student's last name, one...
7
4077
by: Johnathan Doe | last post by:
I can google search to find the range of values that can be represented in a float by reading up on the IEEE std, but is that the same as how many distinct values that can go in a float type? ...
2
10999
by: jvb | last post by:
I am trying to find a way, other than iterating through every row or requerring the database, to get the distinct values from a column in a datatable. Any help would be appreciated. Thanks.
0
1127
by: Benny | last post by:
I am trying to figure out the best way to create a filtering user control. I have 3 fields I am using and therefore have 3 combobox's that all need to display distinct values. The resulting...
3
1575
seshu
by: seshu | last post by:
hi every body this is seshu i have a problem with data grid in vb how get the values in to data grid of my sql query i mean i have a query when i execute this in my sql it is...
1
3497
newnewbie
by: newnewbie | last post by:
Desperately need help in creating a query to count unique values in a table. I am a Business analyst with limited knowledge of Access….My boss got me ODBC connection to the underlying tables for our...
9
2192
by: obrienkev | last post by:
Hi, How do I ensure that DISTINCT values of r.GPositionID are returned from the below?? SELECT CommentImage AS ViewComment,r.GPositionID,GCustodian,GCustodianAccount,GAssetType FROM...
14
2697
by: toadmaster | last post by:
I am trying to remove any duplicate value and display just the unique values using the select query below. I need the select query to display just the distinct values based on Member.ID SELECT...
1
3002
by: kgandu | last post by:
Is there anyway that we can get the distinct values of the column on which there exist a partition. eg : for my fact table the date is partitioned for each date. if i select the distinct values of...
1
3048
by: pb2000 | last post by:
Hello, I am beginner in MSSQL. After writing: SELECT DISTINCT UpDate AS ExpirationDate FROM MyTable
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.