Page 1 of 1

Select from 2 tables

Posted: Mon Jan 28, 2013 3:28 am
by bwan37
I try to do this on the following 2 table... but return "ERROR: Table does not exist"
Can anyone give me some help? Thanks a lot :D

SELECT category.name FROM category, category_used WHERE category.id = category_used.category_id

Here's my 2 tables:
CREATE TABLE category (
id int(2) AUTO_INCREMENT,
name varchar(16) NOT NULL,
PRIMARY KEY(id)
);

CREATE TABLE category_used (
category_id int(2) AUTO_INCREMENT,
model_num varchar(16),
PRIMARY KEY(category_id, model_num)
);

Re: Select from 2 tables

Posted: Mon Jan 28, 2013 12:22 pm
by requinix
If the error says the table does not exist then I would have to venture a guess that the table does not exist.

Are you connecting to the right server? Using the right database?