Left join

From: Zengfa Gao <zfgao(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Left join
Date: 2003-09-05 17:06:50
Message-ID: 20030905170650.53972.qmail@web41004.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, all,

I tried to use "left join" to select data from my
database. Result is come out, but I didn't see the
value of "displayString". I added "left outer join",
same result.

SELECT devices.ProductType, devices.deviceKey,
devices.fullDNSName, deviceTypesEnum.displayString,
deviceTypesEnum.enumId FROM devices
LEFT JOIN deviceTypesEnum ON deviceTypesEnum.enumId
= devices.productType;

Can anyone tell me how to modify this query?

Thanks a lot!

Zengfa

[root(at)scmlin46 data]# psql -Umxadmin mydb_v1_0;
Welcome to psql 7.3.2, the PostgreSQL interactive
terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

mydb=# SELECT devices.ProductType,
devices.deviceKey, devices.fullDNSName,
deviceTypesEnum.displayString, deviceTypesEnum.enumId
FROM devices
mysql=# LEFT JOIN deviceTypesEnum ON
deviceTypesEnum.enumId = devices.productType;
producttype | devicekey | fulldnsname |
displaystring | enumid
-------------+-----------+--------------------+---------------+--------
0 | 1 | scmlin46 | |
(1 row)

mydb=#

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edwin Quijada 2003-09-05 17:07:46 Panic Index!!!!
Previous Message Jurgen Defurne 2003-09-05 17:05:45 Detailed error message information