这里用一个实例来演示PostgreSQL存储过程如何返回数据集。
1、首先准备数据表
复制代码 代码如下:
//member_category
create table member_category(id serial, name text, discount_rate real, base_integral integer);
alter table member_category add primary key(id);
alter table member_category add check(name<>”);
create table member_category(id serial, name text, discount_rate real, base_integral integer);
alter table member_category add primary key(id);
alter table member_category add check(name<>”);
//member
create table member(id serial, member_num text, name text, category_id integer, account numeric(16,2), integral integer, phone text, birthday date, qq integer, email text, status integer, address text, tip text, start_date date, valid_date integer, password text, creator integer, store_name text);
alter table member add primary key(id);
alter table member add foreign key(creator) references employee;
alter table member add foreign key(category_id) references member_category;
alter table member add onaccount int;
alter table member add onaccount int;
alter table member add store_name text;
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/232758.html
赞 (0)