Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#1052 - Column: 'county_id' in where clause is ambiguous

Status
Not open for further replies.

gokeeffe

Programmer
Jan 11, 2005
170
IE
Can some one help me with the following

I keep getting this error

#1052 - Column: 'county_id' in where clause is ambiguous

with the following SQL command

SELECT contact_name,contact_number,secondary_level,junior_subjects
FROM users,secondary_level,grind_record,counties,junior_subjects
WHERE users.user_id = grind_record.user_id
AND secondary_level.secondary_level_id = grind_record.secondary_level_id
AND junior_subjects.junior_subject_id = grind_record.junior_subject_id
AND county_id = "23"

If I replace county_id with county_name and put in a value then it works but I want to be able to pass my county_id to this command

Tks


 
SELECT contact_name,contact_number,secondary_level,junior_subjects
FROM users,secondary_level,grind_record,counties,junior_subjects
WHERE users.user_id = grind_record.user_id
AND secondary_level.secondary_level_id = grind_record.secondary_level_id
AND junior_subjects.junior_subject_id = grind_record.junior_subject_id
AND ?.county_id = "23"

Shouldn't this be something like:
countries.country_id

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top