DD.WellWorkover.Cloud/AsbCloudDb/UsefulQueries/Export_for_LMK.sql
2022-02-22 11:03:27 +05:00

10 lines
589 B
SQL

select t_cluster.caption as cluster,
t_well.caption as well,
t_well.id_telemetry
from t_cluster
join t_well on t_well.id_cluster = t_cluster.id
where t_cluster.caption in ('82', 'ê50 Á', 'ê8', '6 A') and t_well.id_telemetry is not null
order by cluster , well
\copy (select "date", "mode", well_depth, bit_depth, hook_weight, hook_weight_idle, axial_load, block_speed, block_position, rotor_speed, rotor_torque, flow, flow_idle, pressure, pressure_idle from t_telemetry_data_saub where id_telemetry = 137) to '/home/asb/export/dump_c_82_w_2533_t_137.csv' DELIMITER ';' CSV header;