How do I select composite array element that satisfy specific conditions.

From: a <372660931(at)qq(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: How do I select composite array element that satisfy specific conditions.
Date: 2018-05-23 09:42:31
Message-ID: tencent_56F57B4C4E55B65B7DE43183@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, say if I have composite type and table

create type A as(
x float8,
y float8
);

create table B(
Ay A[]
);

insert into B
values(array[
(1,2)::A,
(3,4)::A]
);

How could I select the element of Ay that satisfy x=3??

Thank you so much!!

Shore

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steven Winfield 2018-05-23 09:43:36 RE: Insert data if it is not existing
Previous Message tango ward 2018-05-23 09:03:37 Insert data if it is not existing