Hi sqlite-users,
I have a following problem. In my database there are 3 table:
CREATE TABLE [Samochody]
(
[IDsam] integer,
[Samochod] varchar (50),
PRIMARY KEY ([IDsam])
);
CREATE TABLE [Modele]
(
[IDmod] integer,
[IDsam] integer,
[Model] varchar (50),
PRIMARY KEY ([IDmod])
);
CREATE TABLE [PomiarBledow]
(
[IDpomiaru] integer,
[IDmod] integer,
[IDkol] integer,
PRIMARY KEY ([IDpomiaru])
);
In tables are some hypothetical data:
INSERT INTO [Samochody] ([Samochod]) VALUES ('Number1'); /-> IDsam=1;
INSERT INTO [Modele] ([IDsam], [Model]) VALUES ('1', 'Bus'); /->
IDmod=1;
INSERT INTO [Modele] ([IDsam], [Model]) VALUES ('1', 'Truck'); /->
IDmod=2;
INSERT INTO [PomiarBledow] ([IDmod], [IDkol]) VALUES ('1', '1'); /->
IDpomiaru=1;
INSERT INTO [PomiarBledow] ([IDmod], [IDkol]) VALUES ('1', '2'); /->
IDpomiaru=2;
INSERT INTO [PomiarBledow] ([IDmod], [IDkol]) VALUES ('2', '4'); /->
IDpomiaru=3;
INSERT INTO [PomiarBledow] ([IDmod], [IDkol]) VALUES ('2', '5'); /->
IDpomiaru=4;
Now I try to execute SQL query:
SELECT PomiarBledow.IDpomiaru, Samochody.Samochod
FROM (PomiarBledow INNER JOIN Modele ON PomiarBledow.IDmod =
Modele.IDmod) INNER JOIN Samochody ON Modele.IDsam = Samochody.IDsam
WHERE (((PomiarBledow.IDpomiaru)=2));
and I get en error: "Error 1 - No such column: PomiarBledow.IDpomiaru"
In MSAccess there is no problem to execute such query. What is wrong
with it?
Regards
WojciechW.