sql - Minimum and Maximum values --Oracle -
Trying to get this output:
Obtaining this output in Oracle 8i Trying:
Column 1 | Time ________ _______ ABC 00:00:01 END | 01:00:03 123 | End | ABC | 00:00:08 END | ABC | 00:00:10 END | 01:00:10
with this output from another query
column1 | Starttime | Endtime | ID ________ | ___________ | ___________ | ABC | 00:00:01 | 01:00:01 | 1 ABC 00:00:02 | 01:00:02 | 1 ABC 00:00:03 | 01:00:03 | 1 123. 00:00:04 | 01:00:04 | 2 123 | 00:00:05 | 01:00:05 | 2 123 | 00:00:06 | 01:00:06 | 2 123 | 00:00:07 | 01:00:07 | 2 ABC 00:00:08 | 01:00:08 | 3 ABC 00:00:09 | 01:00:09 | 3 ABC 00:00:10 | 01:00:10 | 4
This query only receives the minimum and maximum for the start-up column:
SELECT (CASE WHEN NN = 1 THEN column 1 ELSE 'END' END) as the column 1, (for the first time with the KSENENNN = 1, ELSE last time END) for the first time as "time" (select column 1, id, minute (initial time), max (start time) Lastly join T-Group, column 1, ID) Join T cross (Select from Dual Union as SELECT 1, Dual to 2) D, column 1, n ORDER by NN;
Now I have one more column called endtime
, I wonder how I can understand this column and END
Can you get the value from this column instead? I have been struggling due to nn
1
when I have only one record for id
.
Just try using the question below,
Selection 'ABC' COL1, '00: 00: 01 'STARTTIME, '01: 00: 01' ENDTIME, '1' ID Selecting Doubles Union 'ABC' COL1, '00: 00: 02 ' 'ABC' COL1, '00: 00: 03 'STARTTIME, '01: 00: 03' per day, '1' ID selected by double union, '1' id, union of the union by STARTTIME, '01: 00: 02 'interval,' 1 'id Select '123' COL1, '00: 00: 04 'STARTTIME, '01: 00: 04' Anime, 'Select 2DID Unit' 123 'Call 1, '00: 00: 05' Start, 01: 00: 05 'Intervals, 2' Dul You Choose '123' call '123' call 1, 00:00:06 'STARTTIME, '01: 00: 06' ENDTIME, '2' id '123' call from dual union 1, '00: 00: 07 'start-time,' 01: 00: 07 'Endeam,' 2 'doubles union selection' ABC 'call 1, '00: 00: 08' start-up, '01: 00: 08 '' ABC ' Call 1, '00: 00: 09 'Start-time, '01: 00: 09' Daily, 'ID' L Union selection from 3 DUA 'ABC' COL1, '00: 00: 10 'STARTMI, '01: 00: 10 'Dual' by ID, '4' ID) * Select from COL1, Min (Start), Data from DummyData Group Scroll 1, ID selected by all the Union 'end', Max (ENDTIME) TIMEDATA, Dmmeedeta ordered by ID 1 Group, ID 1) ID, time donor
Comments
Post a Comment