pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Cast type int2vector/array_field to character
2+ messages / 2 participants
[nested] [flat]

* Cast type int2vector/array_field to character
@ 2003-05-06 08:04  Mr.F <fhf_it@csahome.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Mr.F @ 2003-05-06 08:04 UTC (permalink / raw)
  To: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Cast type int2vector/array_field to character
@ 2003-05-06 13:56  Achilleus Mantzios <achill@matrix.gatewaynet.com>
  parent: Mr.F <fhf_it@csahome.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Achilleus Mantzios @ 2003-05-06 13:56 UTC (permalink / raw)
  To: Mr.F <fhf_it@csahome.com>; +Cc: pgsql-sql

On Tue, 6 May 2003, Mr.F wrote:

> 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". :)

look at contrib/intarray package.

> 
> Thanks in advance,
> Fadjar Hamidi
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 

-- 
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-210-8981112
fax:    +30-210-8981877
email:  achill@matrix.gatewaynet.com
        mantzios@softlab.ece.ntua.gr




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-05-06 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-05-06 08:04 Cast type int2vector/array_field to character Mr.F <fhf_it@csahome.com>
2003-05-06 13:56 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>

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