如何从PostgreSQL查询中解析数据,格式化并存储为数组,然后在bash脚本中使用

我有一个psql查询,应在使用前进行格式化。该查询正在寻找2个id的修饰符,并检查modif是否在第一个id中,而不是在另一个id中,如果不是,我需要从中格式化数据

select name,from_date,from_day_seconds,to_date,to_day_seconds,type_id,value 
from ds_temporal_price_modif 
where ds_account_id = 186 
and active = true 
and name not in (select name 
                 from ds_temporal_price_modif 
                 where ds_account_id = 181 
                   and active = true);
 name |      from_date      | from_day_seconds |       to_date       | to_day_seconds | type_id | value
------+---------------------+------------------+---------------------+----------------+---------+-------
 123  | 2019-11-08 01:45:00 |                  | 2019-11-09 00:45:00 |                |       2 |  1.00 

对此:

TemporalModif ADD 123 08.11.19 01:45 09.11.19 00:45 ADD 1.00

类型1 =乘法 类型2 =添加

TemporalModif来自bash脚本,其中包含CMD行,可以执行此命令。

xyhjojoy 回答:如何从PostgreSQL查询中解析数据,格式化并存储为数组,然后在bash脚本中使用

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3138756.html

大家都在问