School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,443 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,513 people online right now. Registration is fast and FREE... Join Now!




Column fieldname in field list is ambiguous

 

Column fieldname in field list is ambiguous

nagarajan22

29 Jun, 2009 - 01:51 AM
Post #1

New D.I.C Head
*

Joined: 28 Jun, 2009
Posts: 8

Column fieldname in field list is ambiguous

User is offlineProfile CardPM
+Quote Post


Robin Marsh

RE: Column Fieldname In Field List Is Ambiguous

29 Jun, 2009 - 07:55 AM
Post #2

New D.I.C Head
*

Joined: 7 May, 2009
Posts: 13



Thanked: 1 times
My Contributions
You need to give us a clue.

i.e.
What is the code you are trying to run.
User is offlineProfile CardPM
+Quote Post

kzimmerm

RE: Column Fieldname In Field List Is Ambiguous

29 Jun, 2009 - 09:16 AM
Post #3

D.I.C Head
**

Joined: 8 Feb, 2009
Posts: 67



Thanked: 3 times
My Contributions
In general terms you are trying to select a column that has the same name in 2 tables used in that query. IE

table 1

col1 int
col2 int

table 2
col1 int
col2 int
col3 int

query:

select col2 from table 1 inner join table 2 on table 1.col1 = table 2.col1

Since col2 exists in both tables then it will be ambiguous. You would have to provide a table reference to the column. ie;

select table 1.col2 from table 1 inner join table 2 on table 1.col1 = table 2.col1

See the difference?

Hope this helps.

Kurt

select
User is offlineProfile CardPM
+Quote Post

nagarajan22

RE: Column Fieldname In Field List Is Ambiguous

30 Jun, 2009 - 12:35 AM
Post #4

New D.I.C Head
*

Joined: 28 Jun, 2009
Posts: 8

QUOTE(kzimmerm @ 29 Jun, 2009 - 09:16 AM) *

In general terms you are trying to select a column that has the same name in 2 tables used in that query. IE

table 1

col1 int
col2 int

table 2
col1 int
col2 int
col3 int

query:

select col2 from table 1 inner join table 2 on table 1.col1 = table 2.col1

Since col2 exists in both tables then it will be ambiguous. You would have to provide a table reference to the column. ie;

select table 1.col2 from table 1 inner join table 2 on table 1.col1 = table 2.col1

See the difference?

Hope this helps.

Kurt

select


thankyou gentleman
biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:26AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month