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



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to