corretto order join
This commit is contained in:
@@ -163,21 +163,16 @@ sub trxelab {
|
|||||||
my $sthdo = $dbh->do(
|
my $sthdo = $dbh->do(
|
||||||
qq{
|
qq{
|
||||||
select * from (
|
select * from (
|
||||||
(
|
|
||||||
select 'ToolNameID', 'EventDate', 'EventTime', 'NodeNum', 'NodeType', 'NodeDepth',
|
select 'ToolNameID', 'EventDate', 'EventTime', 'NodeNum', 'NodeType', 'NodeDepth',
|
||||||
'XShift', 'YShift', 'ZShift' , 'X', 'Y', 'Z', 'HShift', 'HShiftDir', 'HShift_local',
|
'XShift', 'YShift', 'ZShift' , 'X', 'Y', 'Z', 'HShift', 'HShiftDir', 'HShift_local',
|
||||||
'week_shift', 'week_shift_x', 'week_shift_y', 'week_shift_z', 'T_node', 'water_level', 'pressure', 'load_value'
|
'week_shift', 'week_shift_x', 'week_shift_y', 'week_shift_z', 'T_node', 'water_level', 'pressure', 'load_value'
|
||||||
)
|
|
||||||
union all
|
union all
|
||||||
(
|
|
||||||
select ToolNameID, EventDate, EventTime, NodeNum, NodeType, NodeDepth,
|
select ToolNameID, EventDate, EventTime, NodeNum, NodeType, NodeDepth,
|
||||||
XShift, YShift, ZShift , X, Y, Z, HShift, HShiftDir, HShift_local,
|
XShift, YShift, ZShift , X, Y, Z, HShift, HShiftDir, HShift_local,
|
||||||
week_shift, week_shift_x, week_shift_y, week_shift_z, T_node, water_level, pressure, load_value
|
week_shift, week_shift_x, week_shift_y, week_shift_z, T_node, water_level, pressure, load_value
|
||||||
from ElabDataView
|
from ElabDataView
|
||||||
where ToolNameID = '$tool' and created_at > '$matlab_timestamp'
|
where ToolNameID = '$tool' and created_at > '$matlab_timestamp'
|
||||||
order by EventDate, EventTime, NodeDepth
|
order by ToolNameID DESC, EventDate, EventTime, convert(`NodeNum`, decimal) DESC
|
||||||
)
|
|
||||||
|
|
||||||
) resulting_set
|
) resulting_set
|
||||||
into outfile '$fileelab'
|
into outfile '$fileelab'
|
||||||
fields terminated by ',' optionally enclosed by '"' lines terminated by '\n'}
|
fields terminated by ',' optionally enclosed by '"' lines terminated by '\n'}
|
||||||
|
|||||||
Reference in New Issue
Block a user