unnest

    4热度

    1回答

    我通过使型阵列创建使用PLPGSQL存储过程和做一个循环的过程内,这样我可以插入每个信息类型 CREATE TYPE info AS( name varchar, email_add varchar, contact_no varchar ); CREATE OR REPLACE FUNCTION insert_info( info_array info[

    0热度

    2回答

    我使用postgres来拉取一些数据。我有一个数组(类别),我想排除包含结果“>” select title, short_url, unnest(categories) as cats, winning_offer_amount from auctions where ended_at is not null and '% > %' NOT IN cats group by title,

    0热度

    1回答

    <div ng-repeat="blub in filtered = (blubs | filter:tag)"> <span ng-repeat="tag in blub.tags" class="tag-box">{{tag}}</span> </div> 如何将其解锁为一个查询。我想像是这样的: <span ng-repeat="tag in blub.tags in fil

    0热度

    2回答

    我想对下表执行插入操作,但我无法将日期转换为ARRAY。 CREATE TABLE schedule ( idschedule serial NOT NULL, idzone integer NOT NULL, "time" timestamp without time zone NOT NULL, automatic boolean NOT NULL,

    2热度

    2回答

    假设我有以下表格: table: followers_arrays id | array --------+--------- 1 | {3,4,5} table: small_profiles id | username | pic --------+----------+------- 3 | aaaa | abcd 4 | b

    4热度

    1回答

    我试图将数据作为多维数组传递,并且我得到的行为对我来说似乎很奇怪。具体而言,我试图从2维数组中获取单个元素(因此1维数组超出了我的2维数组),并且它不按我期望的方式工作。 在以下示例#2,4中,& 5按我期望的方式工作,但是1 & 3不。 db=> select s.col[2] from (select array[[1,2,3],[4,5,6]] as col) s; col -----

    0热度

    3回答

    工作我有数据库称为数据,如下列: ID | Name | Weakness1 | Weakness2 | Weakness3 _____________________________________________ 1 | A | W1 | W2 | Null 2 | B | NULL | W2 | W3 3 | C | W1 | NULL | NULL 4 | A | W1

    -2热度

    3回答

    我有一个场flag_acumu在PostgreSQL中的表像这样一些信息: 'SSNSSNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNSNNNNNNNNNNNNNNNNNNNNNNNN‌​NNNNNNNNNNNNNNNNNNNNN' 我需要显示所有的位置那里有一个“S”。通过这个代码,我只能得到'S'的第一个位置,而不是'S'的其他值。 SELECT codn_conce,

    0热度

    1回答

    需要从包含大约100列的表中检索键值对(列名,值)。 以下查询确实需要什么。 With dummy AS ( Select 1 as Col1, 2 as Col2 ) SELECT unnest(array['Col1', 'Col2']) AS "Column Name", unnest(array[Col1, Col2]) AS "Value" FROM d

    0热度

    1回答

    如何在PostgreSQL中查找三维数组的最大(或最小)元素? 是否有任何功能或更快的方法,而不是本?: min:= A[1][1][1]; for i IN 1..9 LOOP for j IN 1..9 LOOP for k IN 1..9 LOOP min := least(min,A[i][j][k]); END LOOP; END LOOP; END LOOP;