小编Bip*_*pin的帖子

For循环遍历临时表

我有一个临时表function(postgresql)

create temporary table temp_table (
id serial
,breakup_id integer
,enquiry_id integer
,estimate_id integer
,customer_name CHARACTER VARYING
,month integer
,year integer
,amount numeric
) on commit drop;
Run Code Online (Sandbox Code Playgroud)

我需要for loop这个临时表来amount使用 更新列breakup_id。如何做到这一点postgresql function?

sql postgresql plpgsql

2
推荐指数
1
解决办法
4224
查看次数

在交叉表查询 postgres 中传递参数

如何crosstab在postgresql. 请参考postgresql中的以下功能

create function sp_nextfollowup_count_byweek(_from timestamp without time zone,_to timestamp without time zone)
returns table(userid integer,username character varying,day1 bigint,day2 bigint,day3 bigint,day4 bigint,day5 bigint,day6 bigint,day7 bigint)as
$BODY$
BEGIN
return query
with cte as(
select * from crosstab($$
select  follow_up_by,next_follow_up_date,count(*) from sales_enquiry_follow_up where next_follow_up_date between _from and _to
group by follow_up_by,next_follow_up_date 
order by follow_up_by,next_follow_up_date$$,$$select date::timestamp without time zone
from generate_series(
  _from,
  _to,
  '1 day'::interval
) date$$)
as(id integer, dd bigint,dd1 bigint,dd2 bigint,dd3 bigint,dd4 bigint,dd5 bigint,dd6 bigint)
)
select …
Run Code Online (Sandbox Code Playgroud)

postgresql crosstab

2
推荐指数
1
解决办法
1794
查看次数

将“Image”标签替换为“a”标签 PHP DOMDocument

我有一些像这样的 HTML 内容

<p><b style="margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Lato, Arial, Helvetica,
 sans-serif; vertical-align: baseline; color: rgb(89, 89, 89);">'60 Degrees South Bar and Grill'</b><span style="color: rgb(89, 89, 89); font-family: Lato, Arial, Helvetica, sans-serif;">&nbsp;
is an imaginative and quirky space that allows diners to enjoy the sea breeze and spectacular views of the Indian Ocean from three terraces. The bar and Grill is ideally situated in&nbsp;</span>
<b style="margin: 0px; padding: 0px; …
Run Code Online (Sandbox Code Playgroud)

html php domdocument

1
推荐指数
1
解决办法
984
查看次数

标签 统计

postgresql ×2

crosstab ×1

domdocument ×1

html ×1

php ×1

plpgsql ×1

sql ×1