How should I modify a SQL query for PostgreSQL?

According to this seems like you either mistyped an alias or used a table name in place of it.

According to this, seems like you either mistyped an alias or used a table name in place of it.

Thank you! Actually, there was a spelling mistake but the real problem as you pointed me in the documentation was different. See my post below.

– m_pGladiator Oct 23 '08 at 7:08.

Somehting=>something postgres=# create database test postgres-# ; CREATE DATABASE postgres=# \c test You are now connected to database "test". Test=# select version(); version ----------------------------------------------------------------------------------------------- PostgreSQL 8.3.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7) test=# create table main(id int); CREATE TABLE test=# create table something_link(mainid int); CREATE TABLE test=# create table something(id int); CREATE TABLE test=# create table type(id int); CREATE TABLE test=# alter table something add column typeid int; ALTER TABLE test=# SELECT * test-# FROM "main" main test-# INNER JOIN "something_link" something_link ON main. "id" = something_link."mainid" test-# INNER JOIN "something" somehting ON something_link.

"somethingid" = something. "id" test-# INNER JOIN "type" type ON something."typeid" = type. "id" test-# ; ERROR: column something_link.

Somethingid does not exist LINE 4: INNER JOIN "something" somehting ON something_link."som... ^ test=# alter table something_link add column somethingid int; ALTER TABLE test=# SELECT * FROM "main" main INNER JOIN "something_link" something_link ON main. "id" = something_link. "mainid" INNER JOIN "something" *somehting* ON something_link."somethingid" = something.

"id" INNER JOIN "type" type ON something. "typeid" = type."id" ; ERROR: invalid reference to FROM-clause entry for table "something" LINE 4: ...hing" somehting ON something_link. "somethingid" = something.... ^ HINT: Perhaps you meant to reference the table alias "somehting".

Test=# SELECT * FROM "main" main INNER JOIN "something_link" something_link ON main."id" = something_link. "mainid" INNER JOIN "something" something ON something_link. "somethingid" = something."id" INNER JOIN "type" type ON something.

"typeid" = type. "id" ; id | mainid | somethingid | id | typeid | id ----+--------+-------------+----+--------+---- (0 rows).

Thank you! There was really typing mistake! But this was not the first problem.

Next time I will not post question late in the night, but wait until next morning with fresh mind :) I'll explain in answer as well the next problem. – m_pGladiator Oct 23 '08 at 7:06.

The real problem is actually not the query, but the PostgreSQL 8.3 default configuration. After correcting the spelling mistake (10x Kendrick Wilson), the problem persisted, until I edited the "postgresql. Conf" file.

There should be a line: add_missing_from = on This line ensures compatibility with the other SQL dialects.

No, this adds the 'missing from' only, which may or may not be compatible with other dialects. Glad you solved your problem though. – Vinko Vrsalovic Oct 23 '08 at 7:30 I mean that even with add_missing_from = on, different compatibility issues still persist.In fact I'm not even sure if MSSQL and Oracle 'add missing froms' too... But you say so, so I'll believe you :) – Vinko Vrsalovic Oct 23 '08 at 7:31.

The real problem is actually not the query, but the PostgreSQL 8.3 default configuration. After correcting the spelling mistake (10x Kendrick Wilson), the problem persisted, until I edited the "postgresql. This line ensures compatibility with the other SQL dialects.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions