PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 23rd, 2003, 10:10 AM
kurious's Avatar
kurious kurious is offline
Prom night: 1973
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2001
Posts: 1,152 kurious User rank is Corporal (100 - 500 Reputation Level)kurious User rank is Corporal (100 - 500 Reputation Level)kurious User rank is Corporal (100 - 500 Reputation Level)kurious User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 2 Days 7 h 36 m 22 sec
Reputation Power: 11
adding missing FROM-clause entry for table

I'm getting a notice for a query:

adding missing FROM-clause entry for table "promomodel"

The query is:

SELECT PromoModelID
FROM PromoModel, Model
LEFT JOIN Supplier ON Supplier.SupplierID = PromoModel.SupplierID

The notice doesn't appear if I switch the two tables names in the FROM clause:

SELECT PromoModelID
FROM Model, PromoModel
LEFT JOIN Supplier ON Supplier.SupplierID = PromoModel.SupplierID

As I understand it, the order of tables shouldn't matter, so I must be missing something. Could someone fill me in please? (Redhat 7.1, Postgres 7.4beta)


CREATE TABLE Model (
ModelID INT NOT NULL PRIMARY KEY DEFAULT NEXTVAL('model_modelid_seq'),
Code VARCHAR(30) NOT NULL UNIQUE,
Name VARCHAR(25) NOT NULL,
ProductCatID INT REFERENCES ProductCat (ProductCatID),
BusinessCatID INT REFERENCES BusinessCat (BusinessCatID),
IsActive BOOLEAN NOT NULL
);



CREATE TABLE Supplier (
SupplierID INT NOT NULL PRIMARY KEY DEFAULT NEXTVAL('supplier_supplierid_seq'),
Code CHAR(4) NOT NULL UNIQUE,
Name VARCHAR(30) NOT NULL,

CurrencyID INT REFERENCES Currency (CurrencyID),

FrameRatioCatID INT REFERENCES FrameRatioCat (FrameRatioCatID),
GradeRatioCatID INT REFERENCES GradeRatioCat (GradeRatioCatID),

SupplierGradeCatID INT REFERENCES SupplierGrades (SupplierGradesID),

PriceListCode VARCHAR(8),

IsActive BOOLEAN
);


CREATE TABLE PromoModel (
PromotionID INT NOT NULL REFERENCES Promotion (PromotionID) ON DELETE CASCADE,
ModelID INT NOT NULL REFERENCES Model (ModelID) ON DELETE CASCADE,

SupplierID INT REFERENCES Supplier (SupplierID),
DisplayFabricID INT REFERENCES MFabric (MFabricID),

PromoModelID INT NOT NULL UNIQUE DEFAULT NEXTVAL('promomodel_promomodelid_seq'),

PRIMARY KEY (PromotionID, ModelID)
);

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > adding missing FROM-clause entry for table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT