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

Join Statement

P: 3
Simple Join Statement Help
--------------------------------------------------------------------------------

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
Expand|Select|Wrap|Line Numbers
  1. create table "PublicHouse"
  2. (PublicHouseID char (20),
  3. PubName Char (20),
  4. Address varchar (20),
  5. Town char (20),
  6. County varchar (20));
  7.  
PublicHouse Beer;
Expand|Select|Wrap|Line Numbers
  1. create table "Brewer"
  2. (BrewerName char (20),
  3. Address varchar (20),
  4. Town char (20),
  5. County char (20));
  6.  
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;
Expand|Select|Wrap|Line Numbers
  1. Select PublicHouse.PublicHouseID, PublicHouseBeer.BeerName, PublicHouse.Address
  2. From "PublicHouse", "PublicHouseBeer"
  3. Where (PublicHouse.PublicHouseID = PublicHouseBeer.PublicHouseID)
  4. AND PublicHouseBeer.BeerName = 'Ten';
  5.  
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+
2 Replies


pbmods
Expert 5K+
P: 5,821
Heya, ltansey. Welcome to TSDN!

You posted this in both the MySQL and Oracle forums. Which database server are you using?
Oct 23 '07 #2

code green
Expert 100+
P: 1,726
You have named your tables PublicHouse and Brewer,
but your SELECT query refers to them as PublicHouse and PublicHouseBeer.
Oct 24 '07 #3

Post your reply

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