Thursday 15 August 2013

datetime - mysql select all calculate difference bewteen multiple rows to on result from pivot -


I have a pivot table from a root table on SQL FIDE, this link:

Here I Try to calculate the difference between "arbitrage", "arbeissende" and "projections" and "projections".

The problem is, if there is more than one value, then calculation does not work like this:

1 9.06.2013 07:27 27: 27,19.06 2013 09:08:58

I want the data to be in a different or in the best position, only to see the result of differnces merge.

There is no possibility of obtaining root data in any other way because it is generated by an interface

I am assuming that the data is coming to the Consensus form - it is not that you have created it substring_index () and reverse () , It can unconnect it with a table that generates numbers.

The following query does not undone the ConsentNet, then return the results back to the group:

 . *, Amount (HOUR (TIME (FMERFTOTTOTTOTTOTFT (RBTBGN, '% D.% M% YY% H:% i:% s'), STR_TO_DATE (RBITADTA,'% D.% Y% Y% H:% i (% I:% s'))) In ProJektzeit, select DriverName (when the case nn = 1 substring_index (arbeitsbeginn, ',', 1) other reverse (substring_index (arbeitsbeginn, ',', 2)), ',', 1) ) Finally, in the form of arbeitsbeginn, (case when nn = 1 then substring_index arbeitsende, ',', 1) any other reverse (substring_index (reverse (substring_index (Case is nn = 1 then substring_index (Projektbeginn, ',', 1) and reverse (substring_index (reverse 'substring_index') (arbeitsende ',', 2)), ',', 1) end in the form of arbeitsende Projektbeginn (as the case when = nn 1 then substring_index (Projektbeginn, ',', 1) any other reverse (substring_index (reverse) (As substring_index (ProjektEnde, ',', 2)), ',', 1)) end (select drivername, group_concat (if as projektEnde (ACTIONTEXT = 'Arbeitsbeginn', DATETIME, zero)) In 'Arbeitsbeginn', group_concat (IF (ACTIONTEXT = 'Arbeitsende', DATETIME, zero)) as 'Projektbeginn' 'Arbeitsende', group_concat (IF (ACTIONTEXT = 'Punjab', DATETIME, zero) As a cross JOY (Select 1 as N 1 Select all 2), group_concat (IF (ACTIONTEXT = 'PE', DATETIME, zero)) as 'ProJektende' FROM geoImportRoot Group by DRIVERNAME) ) Driver Group    

No comments:

Post a Comment