X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4AB4FD1DA9B for ; Fri, 16 Jan 2004 10:07:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 90292-10 for ; Fri, 16 Jan 2004 06:06:44 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id AE9CFD1B4DF for ; Fri, 16 Jan 2004 06:06:42 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i0GA6gU6087936 for ; Fri, 16 Jan 2004 10:06:42 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i0G9dICY038722 for pgsql-sql@postgresql.org; Fri, 16 Jan 2004 09:39:18 GMT From: "Thomas Wegner" X-Newsgroups: comp.databases.postgresql.sql Subject: Problem with LEFT JOIN Date: Fri, 16 Jan 2004 10:39:17 +0100 Organization: Hub.Org Networking Services Lines: 22 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=BAYES_30, PRIORITY_NO_NAME, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200401/142 X-Sequence-Number: 16535 Hello, whats wrong with this SQL?: SELECT L.*, A."lastname" AS firma_value, T."string_val1" AS type_value FROM "lists" L, "typecode" T LEFT JOIN "adressen" A ON A."id_adressen"=L."firma" WHERE T."id_typecode"=L."lists_type" ORDER BY L."id_lists" I get this: ERROR: relation "l" does not exist This version work, but i need a LEFT JOIN (L."firma" can have NULL): SELECT L.*, A."lastname" AS firma_value, T."string_val1" AS type_value FROM "lists" L, "typecode" T, "adressen" A WHERE T."id_typecode"=L."lists_type" AND A."id_adressen"=L."firma" ORDER BY L."id_lists" ------------------------------------------ Thomas Wegner