Posted on 2012-09-10
Last Modified: 2012-09-11
HI Guys

Table1 :  Name,Date,Banking,Mailing,HoursIn.(Fields)
Table2:   Name,Date,Sorting,Printing.

I am trying to join these two table by queries , so that output will be

Date, Name, Banking ,Mailing, Sorting, Printing ,HoursIn

When I am joining these two table I am gettting the duplicate data

Any suggesstion will be helpful
Question by:surah79
    LVL 6

    Accepted Solution

    Add DISTINCT to your query:

    SELECT DISTINCT [Table1].[Name], [Table1].[Date],[Table1].[Banking],[Table1].[Mailing],[Table1].[HoursIn],[Table2].[Sorting],[Table2].[Printing] FROM TABLE1 INNER JOIN table2 ON [Table1].[Name] = [Table2].[Name]

    You could also use a LEFT JOIN or RIGHT JOIN depending on your needs.

    Author Closing Comment

    Thanks a lot man sorry for the late reply this has helped me

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
    We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now