Query (view) question - Mailing list pgadmin-support

From Art Fore
Subject Query (view) question
Date
Msg-id 1171276808.24443.12.camel@linux-latitude.site
Whole thread Raw
List pgadmin-support
I have been trying to get a query going in a postgres database, a simple
on at that, and have had no success expcept using Access.

Here is the query that works in Access.

SELECT remote_ALL_PARTS.PARTNUM, public_datasheet_address.Datasheet &
remote_ALL_PARTS.Datasheet AS Expr1, public_datasheet_address.Datasheet
& remote_ALL_PARTS.Outline AS Expr2, public_datasheet_address.Footprint
& remote_ALL_PARTS.Footprint AS Expr3
FROM remote_ALL_PARTS, public_datasheet_address
WHERE (((remote_ALL_PARTS.PARTNUM) Like "091-" & "*"));


I tried this as a view with pgadmin with slight mods, This one below
works

SELECT "ALL_PARTS"."PARTNUM", "ALL_PARTS"."Datasheet",
"ALL_PARTS"."Outline", "ALL_PARTS"."Footprint"  FROM "ALL_PARTS" "ALL_PARTS" WHERE "ALL_PARTS"."PARTNUM"::text ~~
'021-%'::text;

But, if I do the following

SELECT "ALL_PARTS"."PARTNUM", "datasheet_address","sheet" ||
"ALL_PARTS"."Datasheet", "ALL_PARTS"."Outline", "ALL_PARTS"."Footprint"  FROM "ALL_PARTS" "ALL_PARTS",
"datasheet_address"
"datasheet_address" WHERE "ALL_PARTS"."PARTNUM"::text ~~ '021-%'::text;

I get an error that it cannot modify "Datasheet"

If I change to 

SELECT "ALL_PARTS"."PARTNUM", "datasheet_address","sheet" ||
"ALL_PARTS"."Datasheet" AS "Exp1", "ALL_PARTS"."Outline",
"ALL_PARTS"."Footprint"  FROM "ALL_PARTS" "ALL_PARTS", "datasheet_address"
"datasheet_address" WHERE "ALL_PARTS"."PARTNUM"::text ~~ '021-%'::text;

I still get a similar error.


Have searched for concatenating to fields, but had no success. Can
anyone help? I hope so, otherwise, will have to go to a Access database
and I do not want to do that.

Art





pgadmin-support by date:

Previous
From: Richard Huxton
Date:
Subject: Re: [SQL] Password Policy
Next
From: "Joris Dobbelsteen"
Date:
Subject: Re: Query (view) question