Solved

Ambiguous column name 'CustID'.

Posted on 2008-10-22
2
1,182 Views
Last Modified: 2013-12-07
Hello Experts,

I have 2 tables Customer and GiftCerticate both has a column name CustID

am trying to write the below query to check email and dob from Customer and this custid should exist
in giftcertificate table ...

SELECT CustID FROM Customer, GiftCertificate
WHERE Customer.CustEmail='test@test.com'  
AND Customer.CustDOB='15/10/1906'  
AND GiftCertificate.CustID = Customer.CustID


but i am getting this error
Ambiguous column name 'CustID'..

please can someone advise
thanks
0
Comment
Question by:learningnet
2 Comments
 
LVL 3

Accepted Solution

by:
Blackninja2007 earned 300 total points
ID: 22776677
SELECT customer. CustID
FROM Customer
inner join  GiftCertificate on GiftCertificate.CustID = Customer.CustID
WHERE Customer.CustEmail='test@test.com'  
AND Customer.CustDOB='15/10/1906'  


Derek
0
 
LVL 8

Assisted Solution

by:newbie27
newbie27 earned 200 total points
ID: 22776681
try this

SELECT  Customer.CustID FROM Customer, GiftCertificate
WHERE Customer.CustEmail='test@test.com'  
AND Customer.CustDOB='15/10/1906'  
AND GiftCertificate.CustID = Customer.CustID
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql query 5 70
how to replace '&' and '()' in sql query for oracle using regex 8 61
oracle 11g 23 51
Oracle 12c database link between pdb not working 20 48
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to take different types of Oracle backups using RMAN.

867 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

17 Experts available now in Live!

Get 1:1 Help Now