Skip site navigation (1) Skip section navigation (2)

Query (view) question

From: Art Fore <art(dot)fore(at)comcast(dot)net>
To: Pgadmin-Support <pgadmin-support(at)postgresql(dot)org>
Subject: Query (view) question
Date: 2007-02-12 10:40:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

"ALL_PARTS"."Outline", "ALL_PARTS"."Footprint"
  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"
  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",
   FROM "ALL_PARTS" "ALL_PARTS", "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.



pgadmin-support by date

Next:From: Joris DobbelsteenDate: 2007-02-12 11:00:35
Subject: Re: Query (view) question
Previous:From: Richard HuxtonDate: 2007-02-12 08:19:15
Subject: Re: [SQL] Password Policy

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group