pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mr.F <fhf_it@csahome.com>
To: pgsql-sql@postgresql.org
Subject: Cast type int2vector/array_field to character
Date: Tue, 6 May 2003 15:04:09 +0700
Message-ID: <000801c313a6$12b02b20$de00a8c0@fhf> (raw)
In-Reply-To: <20030506012818.GA8384@wolff.to>

Forgiveness if have been asked previously.

Simple question:
1. How can I cast type int2vector/array_field into character?
2. My case like this: I have 2 table,
first table: 

Field1 Field2
====== ======
1      aaaaa
2      bbbbb
3      ccccc
4      ddddd
5      eeeee

second table: (only one field)

Array_Integer
=============
1 2 4

Wishing to be yielded from relationship both of that:

Result
======
aaaaa
bbbbb
ddddd

How command of SQL to get that result?

exist in my mind now: "select * from table1 where field1 in (select
Array_Integer from table2". :)

Thanks in advance,
Fadjar Hamidi




view thread (2+ messages)  latest in thread

Message-ID: <000801c313a6$12b02b20$de00a8c0@fhf>
Permalink:  ../000801c313a6$12b02b20$de00a8c0@fhf/
Also on:    postgresql.org/message-id/000801c313a6$12b02b20$de00a8c0@fhf

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fhf_it@csahome.com
  Subject: Re: Cast type int2vector/array_field to character
  In-Reply-To: <000801c313a6$12b02b20$de00a8c0@fhf>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox