Solved

Ambiguous column name 'CustID'.

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
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

744 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

8 Experts available now in Live!

Get 1:1 Help Now