By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,974 Members | 1,834 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,974 IT Pros & Developers. It's quick & easy.

Simple Join Statement Help

P: 3
I have a problem concerning a join statement query, the two table are called PublicHouse & PublicHouseBeer, below are the following tables are there attributes;

PublicHouse Table

create table "PublicHouse"
(PublicHouseID char (20),
PubName Char (20),
Address varchar (20),
Town char (20),
County varchar (20));

PublicHouse Beer;

create table "Brewer"
(BrewerName char (20),
Address varchar (20),
Town char (20),
County char (20));

The query is list all the publicHouses & related information (address etc) that supply "Ten" Beer. (Ten is the name of the beer).

Below is my attempt at the query;
Select PublicHouse.PublicHouseID, PublicHouseBeer.BeerName, PublicHouse.Address
From "PublicHouse", "PublicHouseBeer"
Where (PublicHouse.PublicHouseID = PublicHouseBeer.PublicHouseID)
AND PublicHouseBeer.BeerName = 'Ten';

The following error message came up "PUBLICHOUSEBEER"."BEERNAME": invalid identifier

Any help would be very much appreciated
Oct 22 '07 #1
Share this Question
Share on Google+
5 Replies


debasisdas
Expert 5K+
P: 8,127
where is this table PUBLICHOUSEBEER ?
Oct 23 '07 #2

P: 5
Beername is not a field in publichousebeer.check it
Oct 23 '07 #3

amitpatel66
Expert 100+
P: 2,367
You dont have PublicHouseID column as well in the publichousebeer table.
Create the table properly with required fields
Oct 23 '07 #4

P: 3
where is this table PUBLICHOUSEBEER ?
Yeah sorry, made a mistake, copy & pasted the wrong table in; the publichousebeer table looks like the following;

Public House Beer Table
create table "PublicHouseBeer"
(PublicHouseID number (20),
BrewerName char (20),
BeerName char (20),
CurrentRating char (20));

Table created.

the beername attribute is there as shown above, I looked at the query so many times, think it may be a structural problem?

I think it may need a second eye to look at
Oct 23 '07 #5

amitpatel66
Expert 100+
P: 2,367
Yeah sorry, made a mistake, copy & pasted the wrong table in; the publichousebeer table looks like the following;

Public House Beer Table
create table "PublicHouseBeer"
(PublicHouseID number (20),
BrewerName char (20),
BeerName char (20),
CurrentRating char (20));

Table created.

the beername attribute is there as shown above, I looked at the query so many times, think it may be a structural problem?

I think it may need a second eye to look at
Your query is in sync with your table structure.
I assume you are running the query from the same schema where you have created a table??
Oct 24 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.