Solved

VB.net SQL The objects  in the FROM Clause have the same exposed names

Posted on 2014-07-24
2
282 Views
Last Modified: 2014-07-24
Hi. I get the following error in the SQL Statement built below. How do I rectify this

The objects Polycom_Products and Polycom_Products in the FROM Clause have the same exposed names. Use correlation names to distinguish them

            Dim sSQL As String
            sSQL = "Select Polycom_Products.*, Photos.* "
            sSQL = sSQL & " From Polycom_Products Left Join Photos On Polycom_Products.Category2 = Photos.Category2 And Polycom_Products.Category3 = Photos.Category3"
            sSQL = sSQL & ",Polycom_Products Left Join Costs On Polycom_Products.[Product ID] = Costs.[ProdID]"
0
Comment
Question by:murbro
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
Comment Utility
It seems that you have fields with the same name in both tables (like Category2 and Category3).

Instead of querying for all fields (*), specify the name of the fields you want without duplicates.
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

763 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

10 Experts available now in Live!

Get 1:1 Help Now