Changes between Version 1 and Version 2 of SortingResults


Ignore:
Timestamp:
09/04/18 15:31:22 (6 years ago)
Author:
alisdair
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SortingResults

    v1 v2  
    36362014-09-19T01:00:36}{ 2014-09-19T01:00:35 2014-09-19T01:00:36} 
    3737}}} 
     38The sample query is a follows 
     39{{{ 
     40SELECT 
     41   date_obs, 
     42   date_obs as date_end, 
     43   t_rec_index, 
     44   fsn, 
     45   recnum, 
     46   sunum, 
     47   wave as wavemin, 
     48   wave as wavemax, 
     49   clusterid, 
     50   fileid 
     51FROM vso.%s 
     52WHERE 1=1 %%s 
     53  AND t_rec_index IN ( 
     54    SELECT hashed.d 
     55    FROM ( 
     56      SELECT MIN(t_rec_index) as d, 
     57        FLOOR( ( EXTRACT(EPOCH FROM date_obs) - EXTRACT(EPOCH FROM CAST(? AS TIMESTAMP) ) ) / ? ) AS hash 
     58      FROM vso.%s 
     59      WHERE 1=1 %%s 
     60      GROUP BY hash 
     61    ) AS hashed 
     62  ) 
     63%%s => where clause ; %s => table name 
     64}}} 
     65 
    3866**Why does this happen?** \\ 
    3967\\