当前位置:网站首页>[postgresql]postgresql custom function returns an instance of table type
[postgresql]postgresql custom function returns an instance of table type
2022-07-03 20:13:00 【just-do-it-zzj】
CREATE OR REPLACE function test_retable(p_id int)
RETURNS table(id int, name VARCHAR2(50))
LANGUAGE PLPGSQL
AS $$
DECLARE
/*
1. Create table
create table test1(c1 int ,c2 varchar2(50));
insert into test1(c1,c2) values(1,'2');
insert into test1(c1,c2) values(2,'2');
insert into test1(c1,c2) values(1,'3');
2. Execute query function
select * from test_retable(1);
*/
TYPE varray_type IS VARRAY(20) OF INT;
v_varray varray_type;
BEGIN
v_varray := varray_type(1, 2, 3, 4, 5);
RETURN QUERY SELECT c1 AS id, c2 AS name FROM test1 WHERE c1 in (
select regexp_split_to_table(array_to_string(v_varray, ','),',')
);
END ; $$
边栏推荐
- The 29th day of force deduction (DP topic)
- Derivation of decision tree theory
- Fingerprint password lock based on Hal Library
- 2022 - 06 - 30 networker Advanced (XIV) Routing Policy Matching Tool [ACL, IP prefix list] and policy tool [Filter Policy]
- 2. Template syntax
- An old programmer gave it to college students
- Global and Chinese markets for medical temperature sensors 2022-2028: Research Report on technology, participants, trends, market size and share
- Part 28 supplement (XXVIII) busyindicator (waiting for elements)
- Unittest framework is basically used
- 4. Data splitting of Flink real-time project
猜你喜欢

FPGA learning notes: vivado 2019.1 project creation
![2022 - 06 - 30 networker Advanced (XIV) Routing Policy Matching Tool [ACL, IP prefix list] and policy tool [Filter Policy]](/img/b6/5d6b946d8001e2d73c2cadbdce72fc.png)
2022 - 06 - 30 networker Advanced (XIV) Routing Policy Matching Tool [ACL, IP prefix list] and policy tool [Filter Policy]

How can the outside world get values when using nodejs to link MySQL
![Oak-d raspberry pie cloud project [with detailed code]](/img/34/76b461bf03fba373da5b5898c5204c.jpg)
Oak-d raspberry pie cloud project [with detailed code]

Make a simple text logo with DW

Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system

Battle drag method 1: moderately optimistic, build self-confidence (1)

1.4 learn more about functions

5- (4-nitrophenyl) - 10,15,20-triphenylporphyrin ntpph2/ntppzn/ntppmn/ntppfe/ntppni/ntppcu/ntppcd/ntppco and other metal complexes

BOC protected phenylalanine zinc porphyrin (Zn · TAPP Phe BOC) / iron porphyrin (Fe · TAPP Phe BOC) / nickel porphyrin (Ni · TAPP Phe BOC) / manganese porphyrin (Mn · TAPP Phe BOC) Qiyue Keke
随机推荐
AI enhanced safety monitoring project [with detailed code]
Global and Chinese market of liquid antifreeze 2022-2028: Research Report on technology, participants, trends, market size and share
Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
Vscode reports an error according to the go plug-in go get connectex: a connection attempt failed because the connected party did not pro
MySQL dump - exclude some table data - MySQL dump - exclude some table data
First knowledge of database
2022-06-25 advanced network engineering (XI) IS-IS synchronization process of three tables (neighbor table, routing table, link state database table), LSP, cSNP, psnp, LSP
Commands related to files and directories
Cap and base theory
The simplicity of laravel
Today's work summary and plan: February 14, 2022
Win10 share you don't have permission
Use of aggregate functions
BOC protected tryptophan porphyrin compound (TAPP Trp BOC) Pink Solid 162.8mg supply - Qiyue supply
Microsoft: the 12th generation core processor needs to be upgraded to win11 to give full play to its maximum performance
2022-06-28 advanced network engineering (XIII) IS-IS route filtering, route summary, authentication, factors affecting the establishment of Isis neighbor relations, other commands and characteristics
[Yu Yue education] basic reference materials of manufacturing technology of Shanghai Jiaotong University
Professional interpretation | how to become an SQL developer
Global and Chinese markets of lithium chloride 2022-2028: Research Report on technology, participants, trends, market size and share
BOC protected alanine porphyrin compound TAPP ala BOC BOC BOC protected phenylalanine porphyrin compound TAPP Phe BOC Qi Yue supply