Re: Problems with join (no such attribute, but it exists) - Mailing list pgsql-novice

From Juliet May
Subject Re: Problems with join (no such attribute, but it exists)
Date
Msg-id 000d01c31bd3$1432aa60$a1d2a8c0@impsu.net
Whole thread Raw
In response to Problems with join (no such attribute, but it exists)  (Matej Cepl <cepl@surfbest.net>)
List pgsql-novice
PostgreSql doesn't recognize the column because the column name is in
uppercase and you typed in lowercase. You need to surround the uppercase
with quotes as well. Your query should have been written like:

 grass=> SELECT conv."TRACT_ID", tr.tract FROM tracts_towns2000 conv,
tracts2000 tr LIMIT 5;

I hope that helps.

Julie


----- Original Message -----
From: "Matej Cepl" <cepl@surfbest.net>
To: <pgsql-novice@postgresql.org>
Sent: Wednesday, May 14, 2003 10:30 AM
Subject: [NOVICE] Problems with join (no such attribute, but it exists)


> Hi,
>
> I do probably something very silly, but I am total novice in SQL world
> (and social scientist, so no CS professional), but I need PostgreSQL
> back-end for Grass, so I thought I could try to do some light SELECTing.
> Well, I stumbled pretty early:
>
>    grass=> \d tracts_towns2000
>               Table "tracts_towns2000"
>      Column   |         Type          | Modifiers
>    -----------+-----------------------+-----------
>     COMPL_ID  | character varying(18) | not null
>     COUNTY_ID | smallint              | not null
>     TRACT_ID  | integer               | not null
>     TOWN_ID   | smallint              | not null
>     AREA_ID   | smallint              | not null
>    Primary key: tracts_towns2000_pkey
>
>    grass=> \d tracts2000
>            Table "tracts2000"
>       Column   |  Type   | Modifiers
>    ------------+---------+-----------
>     objectid   | bigint  |
>     area       | real    |
>     perimeter  | real    |
>     state      | text    |
>     county     | text    |
>     tract      | text    |
>     ct_id      | text    |
>     logrecno   | text    |
>     blk_count  | integer |
>     total_pop  | bigint  |
>     samp_pop   | bigint  |
>     dry_pct    | real    |
>     dry_acres  | real    |
>     dry_sqmi   | real    |
>     dry_sqkm   | real    |
>     shape_area | text    |
>     shape_len  | text    |
>
>    grass=> SELECT * FROM tracts_towns2000 conv, tracts2000 tr LIMIT 1;
>          COMPL_ID      | COUNTY_ID | TRACT_ID | TOWN_ID | AREA_ID
>     | objectid |    area     | perimeter | state | county | tract
>     |    ct_id    | logrecno | blk_count | total_pop | samp_pop | dry_pct
>     | dry_acres | dry_sqmi | dry_sqkm |              shape_area
>     | shape_len
>     14000US25017341100 |        17 |   341100
>     |       5 |       5 |        1 | 2.55159e+07 |   45288.6 | 25    | 001
>     | 010100 | 25001010100 | 0000856  |       137 |      3431 |     3431
>     |  0.9805 |   6181.92 |    9.659 |   25.017 | 2.55158949367e+007
>     4.52885899988e+004 |
>    (1 row)
>
>    grass=> SELECT conv.tract_id, tr.tract FROM tracts_towns2000 conv,
>    tracts2000 tr LIMIT 5;
>    ERROR:  No such attribute or function 'tract_id'
>
> Can anybody explain me, which stupidy I have commited?
>
>    Thanks,
>
>       Matej Cepl
>
> --
> Matej Cepl,
> GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
> 138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


pgsql-novice by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: MSAccess-like Last() with sorting before grouping
Next
From: Manfred Koizar
Date:
Subject: Re: Problems with join (no such attribute, but it exists)