Solved

Ambiguous column name 'CustID'.

Posted on 2008-10-22
2
1,190 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle encryption 12 61
SQL Workhours Count beetween Workhours 3 40
Update one rows based on previous row 5 30
SQL query to select row with MAX date 7 43
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

697 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