Get the max of this query

DB version: 10 gr 2

My query below is a union of two queries max. Currently, it returns two rows.
select max(to_timestamp(to_char(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')) 
from SHIP_DTL
where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 
AND COMPANY_ID =1
and cost_event_id=1 and END_EFFECTIVE_DATE is not null
union
select max(to_timestamp(to_char(START_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')) from SHIP_DTL
where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 AND COMPANY_ID =1
and cost_event_id=1 and END_EFFECTIVE_DATE is null;

MAX(TO_TIMESTAMP(TO_CHAR(END_EFFECTIVE_DATE,'YYYY-MM-DDHH24:MI:SS'),'YYYY-M
---------------------------------------------------------------------------
09-12-01 05:39:00.000000000
09-12-30 06:55:00.000000000
I want to get the most out of these two lines. So, I tried the following query using double. But I get the error message
SQL> select max (select max(to_timestamp(to_char(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-M
M-DD HH24:MI:SS')) 
  2  from SHIP_DTL
  3  where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 
  4  AND COMPANY_ID =1
  5  and cost_event_id=1 and END_EFFECTIVE_DATE is not null
  6  union
  7  select max(to_timestamp(to_char(START_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:
MI:SS')) from SHIP_DTL
  8  where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 AND COMPANY
_ID =1
  9  and cost_event_id=1 and END_EFFECTIVE_DATE is null) from dual;
select max (select max(to_timestamp(to_char(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD 
            *
ERROR at line 1:
ORA-00936: missing expression
What I'm doing wrong here?
select max(dt) from (
 SELECT MAX(to_timestamp(TO_CHAR(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')) dt
   FROM SHIP_DTL
  WHERE SHIP_DTL.IS_ENABLED = 1
AND SHIP_DTL.IS_DELETED     = 0
AND COMPANY_ID              =1
AND cost_event_id           =1
AND END_EFFECTIVE_DATE     IS NOT NULL
  UNION
SELECT MAX(to_timestamp(TO_CHAR(START_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS'))
   FROM SHIP_DTL
  WHERE SHIP_DTL.IS_ENABLED = 1
AND SHIP_DTL.IS_DELETED     = 0
AND COMPANY_ID              =1
AND cost_event_id           =1
AND END_EFFECTIVE_DATE     IS NULL
)

put in a sub query

Ravi Kumar

Tags: Database

Similar Questions

  • How to get the result using this query?

    Hi using iam under query,

    WITH CTE (SNO, ID, PNT)

    AS

    (SELECT ROWNUM as SNO, TRANS_ID, VCN_NO OF)

    SELECT V.TRANS_ID, V.VCN_NO IN VSL_MOVES V

    WHERE V.END_TIME > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) AND V.END_TIME < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24'))

    AND V.MOVEMENT_TYPE_CODE NOT IN ORDER ("ATA") OF V.VCN_NO, V.END_TIME))

    SELECT ROWNUM as SNO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO, TAB. ARRIVED_DATE, TAB. F_ROM,

    NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. (T_ID),'-') Sailed_Date,.

    NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT P.PORT_NAME OF RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. VSL_NXT_PRT_CALL AND PNT. DOC_NO = TAB. VCN_NO) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT CASE WHEN VBU. BERTH_CODE LIKE "% VOPK" AND THEN "VOPAK" WHAT VBU. BERTH_CODE AS "VSPM %" THEN "VOPAK" ELSE "POF" VBU VSL_BERTH_UNBERTH END WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. (T_ID), "-") DESTINATION

    DE)

    SELECT

    VM. TRANS_ID,

    VM. VCN_NO,

    VM. MOVEMENT_TYPE_CODE,

    (SELECT PNT. VSL_NAME OF PNTS WHERE NBV. DOC_NO = VM. VCN_NO AND ROWNUM < = 1) VESSEL_NAME;

    (SELECT C.COUNTRY_NAME OF COUNTRY C, VESSEL_MASTER M WHERE C.COUNTRY_CODE = M.FLAG AND M.VSL_CODE = VM. VSL_CODE AND ROWNUM < = 1) AS FLAG,.

    (SELECT M.VSL_IMO_NO FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. VSL_CODE AND ROWNUM < = 1) IMO_NO;

    TO_CHAR (VM. END_TIME, "DD/MM/YYYY HH24") ARRIVED_DATE,.

    WHEN VM BOX. MOVEMENT_TYPE_CODE = 'STA' THEN (SELECT P.PORT_NAME FROM RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. LST_PORT_CALL AND PNT. DOC_NO = VM. VCN_NO AND ROWNUM < = 1) WHEN VM. MOVEMENT_TYPE_CODE = 'UTA' THEN (SELECT VB. VSL_BERTH_UNBERTH VB BERTH_CODE WHERE VB. UNBERTH_TRANS_ID = VM. TRANS_ID AND ROWNUM < = 1) END F_ROM.

    --(SELECT T2.ID DELE DE CTE T1 JOIN CTE T2 SUR T1.) SNO = T2. SNO + 1 WHERE T1.ID = VM. TRANS_ID AND T1. NBV = VM. VCN_NO AND T2. NBV = VM. ATD VCN_NO)

    (SELECT T1.ID CTE T1 WHERE SNO = (SELECT T2. SNO + 1 ETC T2 WHERE T2.ID = VM. TRANS_ID AND T2. NBV = VM. T_ID VCN_NO))

    OF VSL_MOVES VM

    WHERE (VM. End_time > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) AND VM. End_time < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')) or

    ((CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. Saileddate T_ID)) > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) and

    (CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. T_ID) saileddate) < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')))

    --(Sailed_Date > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24 ')) AND Sailed_Date < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')))

    AND VM. MOVEMENT_TYPE_CODE IN ('STA', "UTA")

    ) TAB

    now my Question is should I include Sailed date also starttime and endtime (ex: date range of pStartDate and pEndDate I need to display the date sailed respected records)

    I mean the problem is solved, I found the solution

    docks of pof-

    WITH CTE (SL, VCN_NO, VESSEL_NAME, FLAG, IMO_NO, ARRIVED, FROM_, MOVEMENT_TYPE_, NEXT_MOVE, SAILED_DATE, DESTINATION, FID, TID)

    AS

    (SELECT T1.*,

    WHEN T1 BOX. FROM_ = 'POF' THEN 1 OTHER 2 END FID,

    WHEN T1 BOX. DESTINATION = "POF" THEN 1 OTHER 2 END TID

    Of

    (

    SELECT ROW_NUMBER() OVER (PARTITION OF VM. VCN_NO ORDER BY VB. (SL BRTH_ALL_FAST),

    VM. VCN_NO,

    (SELECT M.VSL_NAME FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. VESSEL_NAME VSL_CODE),

    (SELECT C.COUNTRY_NAME OF COUNTRY C, VESSEL_MASTER M WHERE C.COUNTRY_CODE = M.FLAG AND M.VSL_CODE = VM. VSL_CODE AND ROWNUM< =1="" )="" as="">

    (SELECT M.VSL_IMO_NO FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. IMO_NO VSL_CODE),

    VB. BRTH_ALL_FAST HAS ARRIVED,

    (CASE WHEN VM. MOVEMENT_TYPE_CODE = 'ATB' THEN 'ANCHORAGE' WHAT VM. MOVEMENT_TYPE_CODE = "LTB" THEN 'LAND' WHEN VM. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. UNBERTH_TRANS_ID = VB. BERTH_TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM")) THEN 'POF' WHEN VM. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. UNBERTH_TRANS_ID = VB. BERTH_TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE IN ("VOPAK", "SPM")) THEN "VOPAK" OTHER (SELECT P.PORT_NAME FROM RRS, P PORT_MASTER WHERE P.PORT_CODE = PNT. LST_PORT_CALL AND PNT. DOC_NO = VM. FROM_ VCN_NO END)).

    VM. MOVEMENT_TYPE_CODE,

    (SELECT THE VIRTUAL COMPUTERS. VSL_MOVES VMS MOVEMENT_TYPE_CODE WHERE VMS. TRANS_ID = VB. NEXT_MOVE UNBERTH_TRANS_ID),

    VB. UB_LST_LNE_CASTOFF SAILED_DATE,

    NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'UTA' THEN 'ANCHORAGE' WHAT VMS. MOVEMENT_TYPE_CODE = 'BTL' THEN 'LAND' WHEN VMS. MOVEMENT_TYPE_CODE = "UTS" THEN (SELECT P.PORT_NAME FROM RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. VSL_NXT_PRT_CALL AND PNT. DOC_NO = VMS. VCN_NO) WHEN VMS. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. BERTH_TRANS_ID = VMS. TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM")) THEN 'POF' WHEN VMS. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. BERTH_TRANS_ID = VMS. TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE IN ("VOPAK", "SPM")) THEN "VOPAK" OTHERWISE NULL END VSL_MOVES VMS WHERE VB. UNBERTH_TRANS_ID = VMS. (TRANS_ID), "-") DESTINATION

    OF VM, VSL_BERTH_UNBERTH VB VSL_MOVES WHERE (VM. TRANS_ID = VB. BERTH_TRANS_ID)

    AND VM. MOVEMENT_TYPE_CODE LIKE '% TB '.

    AND ((VB. BRTH_ALL_FAST > = TO_TIMESTAMP(:pStartDate,'DD/MM/YYYY HH24:MI') AND VB. BRTH_ALL_FAST<= to_timestamp(:penddate,'dd/mm/yyyy="">

    OR (VB. UB_LST_LNE_CASTOFF > = TO_TIMESTAMP(:pStartDate,'DD/MM/YYYY HH24:MI') AND VB. UB_LST_LNE_CASTOFF<= to_timestamp(:penddate,'dd/mm/yyyy="" hh24:mi'))="">

    AND VB. BERTH_CODE (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM"))

    - AND VM. VCN_NO = 201510336

    ORDER OF VB. BRTH_ALL_FAST

    ) T1

    )

    Select rownum AS SNO, tab2.* of)

    SELECT

    TAB1. VCN_NO, TAB1. VESSEL_NAME, TAB1. FLAG, TAB1. IMO_NO,

    NVL (BOX WHEN TAB1. HAS ARRIVED< to_timestamp(:pstartdate,'dd/mm/yyyy="" hh24:mi')="" then="" '----------'="" else="" to_char(tab1.arrived,'dd/mm/yyyy="" hh24:mi')="" end,'----------')="">

    NVL (BOX WHEN TAB1. HAS ARRIVED< to_timestamp(:pstartdate,'dd/mm/yyyy="" hh24:mi')="" then="" '----------'="" else="" (select="" t2.from_="" from="" cte="" t2="" where="" t2.sl="TAB1.FROM_" and="" t2.vcn_no="TAB1.VCN_NO)" end,'----------'="">

    NVL (CASE WHEN (SELECT T2. DESTINATION OF THE CTE T2 WHERE T2.SL = TAB1. DEST AND T2. VCN_NO = TAB1. VCN_NO) = 'POF' THEN '-' ANOTHER BOX WHEN TAB1. SAILED_DATE > TO_TIMESTAMP (: pEndDate, ' DD/MM/YYYY HH24') THEN '-' ELSE TO_CHAR (TAB1. (SAILED_DATE, "DD/MM/YYYY HH24") A PIECE,'-') SAILED_DATE,.

    NVL (BOX WHEN TAB1. SAILED_DATE > TO_TIMESTAMP (: pEndDate, ' DD/MM/YYYY HH24') THEN '-' ELSE (SELECT CASE WHEN T2. DESTINATION = 'POF' THEN '-' ANOTHER T2. THE END OF THE DESTINATION OF THE CTE T2 WHERE T2.SL = TAB1. DEST AND T2. VCN_NO = TAB1. (END OF VCN_NO), "-") DESTINATION

    DE)

    SELECT THE TAB. VCN_NO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO,

    MIN (TAB. HAPPENED) ARRIVED,

    MIN (TAB.SL) FROM_,

    MAX (TAB. SAILED_DATE SAILED_DATE),

    MAX (TAB.SL) DEST,

    TAB. SNO

    DE)

    SELECT T1.*,

    WHEN T1 BOX. FID = 2 AND T1. TID = 1 THEN 1 WHEN T1. FID = 1 AND T1. TID = 2 THEN 1 WHEN T1. FID = 1 AND T1. TID = 1 THEN 0

    WHEN T1. FID = 2 AND T1. TID = ROWNUM THEN 2 + 1 END OF ANOTHER 3 SNO

    T1 ETC

    ) GROUP OF TABS BY TABS. VCN_NO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO, TAB. SNO

    ) TAB1 WHERE TAB1. SNO<>0

    ) tab2

  • Get the max of a field in a query of County

    Hi, I work with the following SQL query:
    WITH ORDERED_QUERY AS
    (
    SELECT COUNT(SHRTRIT_SBGI_CODE) AS "COUNT OF I",
                SHRTRIT_SBGI_CODE AS "SBGI CODE",
                SHRTRIT_SBGI_DESC AS "INSTITUTION"
    FROM SHRTRIT
    WHERE (SHRTRIT_SBGI_CODE LIKE 'I%'
    GROUP BY SHRTRIT_SBGI_CODE,SHRTRIT_SBGI_DESC
    ORDER BY "COUNT OF I" DESC
    )
    SELECT "COUNT OF I","SBGI CODE","INSTITUTION" 
    FROM ORDERED_QUERY
    WHERE ROWNUM <= 20
    What follows is the table mark code to get a test table:
    create table SHRTRIT
    (
    SBGI_CODE     VARCHAR2(6)     NOT NULL
    SBGI_DESC     VARCHAR2(10)
    ACTIVITY_DATE     DATE
    )
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,10/6/2007 1:47:01 PM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,2/10/2009 3:00:14 AM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,10/6/2007 12:11:56 PM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,2/10/2009 3:00:15 AM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I07979,RIYADH TECHNICAL COLLEGE,9/11/2008 3:01:26 AM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I07979,RIYADH TECHNICAL COLLEGE,7/6/2010 9:00:02 PM)
    /
    {CODE}
    
    What I'm trying to do is get the max ACTIVITY_DATE for the institution when it's listed. For example, the max ACTIVITY_DATE for MING-CHUAN COLL is 2/10/2009 3:00:15 AM. The desired output is one record for MING-CHUAN, with a count of 4, the SBGI code, the Institution Name, and the max activity date of 2/10/2009 3:00:15 AM. However, when I just insert MAX(SHRTRIT_ACTIVITY_DATE) as part of the in-line query, it doesn't work like you'd think. It makes separate records for each date, such that here, there would be one record for 2/10/2009 with a count of 2 and one record for 10/6/2007 with a count of 2 for MING-CHUAN. 
    
    It might actually work with this small amount of data, I don't know because I can't make a test table with these few records to find out. It certainly isn't working with the actual table. I know it has something to do with the aggregation, but I'm not quite sure how to get around this problem. I've tried some different things, but none of them have gotten the desired results.
    
    Any help that you might be able to provide would be greatly appreciated!
    
    Thanks so much,
    Michelle Craig
    Data Coordinator
    Admissions operations and transfer services
    Kent State University                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Not exactly what you're trying to do, but:

    SQL> SELECT  *
      2    FROM  SHRTRIT
      3  /
    
    SBGI_C SBGI_DESC                      ACTIVITY_DATE
    ------ ------------------------------ ----------------------
    I08883 MING-CHUAN COLL                10/06/2007 01:47:01 pm
    I08883 MING-CHUAN COLL                02/10/2009 03:00:14 am
    I08883 MING-CHUAN COLL                10/06/2007 12:11:56 pm
    I08883 MING-CHUAN COLL                02/10/2009 03:00:15 am
    I07979 RIYADH TECHNICAL COLLEGE       09/11/2008 03:01:26 am
    I07979 RIYADH TECHNICAL COLLEGE       07/06/2010 09:00:02 pm
    
    6 rows selected.
    
    SQL> WITH ORDERED_QUERY AS (
      2                         SELECT  COUNT(SBGI_CODE) AS "COUNT OF I",
      3                                 SBGI_CODE AS "SBGI CODE",
      4                                 SBGI_DESC AS "INSTITUTION",
      5                                 MAX(ACTIVITY_DATE) LAST_ACTIVITY_DATE
      6                           FROM  SHRTRIT
      7                           WHERE SBGI_CODE LIKE 'I%'
      8                           GROUP BY SBGI_CODE,SBGI_DESC
      9                           ORDER BY "COUNT OF I" DESC
     10                        )
     11  SELECT  "COUNT OF I",
     12          "SBGI CODE",
     13          "INSTITUTION",
     14          LAST_ACTIVITY_DATE
     15    FROM  ORDERED_QUERY
     16    WHERE ROWNUM <= 20
     17  /
    
    COUNT OF I SBGI C INSTITUTION                    LAST_ACTIVITY_DATE
    ---------- ------ ------------------------------ ----------------------
             4 I08883 MING-CHUAN COLL                02/10/2009 03:00:15 am
             2 I07979 RIYADH TECHNICAL COLLEGE       07/06/2010 09:00:02 pm
    
    SQL> 
    

    SY.

  • Get the Max values and average of the different cycles in the single channel

    Hello

    I'm trying to get the Max values and average of the single channel that has different cycles it contains. I tried to use commands such as Chnclasspeak3 and chnpeakfind, but they were not useful for me. What I need is the Max values and average of the different cycles numbers saved in the data channel.

    Exampld if the string contains 5 numbers of repetitive cycles, then we must find the maximum values and the average of these 5 cycles in the single channel. Attached reference data. This is the .raw file and I have the plugin for it to use in diadem 11.1.

    Kind regards

    X. Ignatius

    Hello, Ignatius,.

    Sorry, it took some time to provide a replacement based on the script for the function. Please take a look at the attached script. I changed the script to use my function if the tiara-version is less than 12. My script function is not as fast and more stable than the implementation of tiara, but for now, it does the job

    Andreas

  • How can I get the max of a measurement value

    How can I get the max of a measurement value?

    http://forums.NI.com/T5/LabVIEW/how-can-I-return-the-maximum-value-from-a-voltage-sensor-over/m-p/30...

    I tried the while loop max-min-solution described in this link. But this using my myRio acceleration measurement no longer works. It seems to hang.

    I use the I2C Communication.

    The inner circle while loop is a bad construction.  It will be either executed once, if enter the Boolean value is True, or forever if the value is false.

    Put your records on the timed loop shift and eliminate inside while loop.  Then your code should work.

  • How to get the Max value in Essbase

    Hello

    I have problem to get the max value of 3 years in Essbase.
    How can I get the max value of Dec 2009, Dec 2010, Dec 2011.
    Suppose the value of Dec 2009 = 1000, dec 2010 = 1500 and Dec 2011 = 2000
    I want to get the max value of these three value, how can I do this in the Essbase calculation Script.
    Any idea?


    Thank you.

    Kind regards

    Joni

    You did not specify if year and period are there separate dimensions, in any case as always a number of different possbilities and I don't have much time today to think about, but only one method can be to use @MAXRANGE

    DIFFICULTY (other members to set, 'Dec')

    'MemberToStoreAgainst' = @MAXRANGE("MemberToFindMaxRangeFor","2009:"2011");

    ENDFIX

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How can I get the rest of this virus off the coast? Ive found a bunch and sank them until I can get online

    How can I get the rest of this virus off the coast? Ive found a bunch and them came down until I can get online but I can 't get to work stations or other programs. I have to run in safe mode to do anything properly. This is where I removed the malware and other viruses but I'm not sure it fixed stuff I need in normal mode.

    How can I get the rest of this virus off the coast? Ive found a bunch and them came down until I can get online but I can 't get to work stations or other programs. I have to run in safe mode to do anything properly. This is where I removed the malware and other viruses but I'm not sure it fixed stuff I need in normal mode.

    Just to add to the answer above, once you have completed the scan with Malwarebytes in SafeMode with network, restart the computer in normal mode, look for the Malwarebytes updates, then perform another analysis.

  • can not get the content in this area (dublin, Ireland)

    tried to download the trial of office clicked on office bureau chief, said he may not get the content in this region dublin Ireland I did something wrong

    Hello

    Many posters have managed to install the trial of Office for download and registration of the trial, and then install. ; instead of simply downloading.

    This answer from another Thread can help you.

    http://answers.Microsoft.com/en-us/Office/Forum/Office_2007-office_install/Microsoft-Office-Download-Manager-message/9b252caf-1bb2-4118-81e3-8878d668d3f7?msgId=dfa48ae1-85D4-4f3F-965B-037795f11399

    "I solved this problem in a surprising way - rather than the Download Manager LAUNCHES, I chose to SAVE it, and then he ran after it and it is more me gave this error."

    See you soon.

  • I had my computer repaired and now I get the message that I need to activate Windows. When I put in the product key, I get the message that this is a mistake. Is there anyway to fix this?

    Product key for Windows Vista

    I had my computer repaired and now I get the message that I need to activate Windows.  When I put in the product key, I get the message that this is a mistake.  Is there anyway to fix this?

    Activate by phone

    http://www.Vistax64.com/tutorials/84488-activate-Vista-phone.html

    Pay attention to step 2: how to do a phone Activation.
    Note: If the activation service informs you that she has failed and cannot help with activation, thenSTAY ON THE LINE and your call will be transferred to an operator of activation which will help you to activate your copy of Vista.

  • Help! All programs will not work. I get the error message: "this file has no program associated with it for performing this action. Create an association in the control panel to define the Associations. "

    When I try to run a program (Internet Explorer, Firefox, CCleaner, etc..) I get the same message: "this file has no program associated with it for performing this action. Create an association in the control panel to define the Associations. "

    I can't find the "Set Associations control panel" and am not sure that he would go if I could find it, and if it work I do not know I know what to do. Help!

    Should I re - publish so that else soeone looks like?

    If you wish.
    Make sure you add a line right at the beginning: you are reposting because we could not have solved other fold it.

    Alternatively, you wait for the next person coming.

    The choice is yours, although generally you would be advised to stay put and wait. For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • I get the message error "this document cannot be printed.

    When you try to print a pdf file, I get the message error "this document cannot be printed. The problem is when I switch to another printer.

    Hello

    OK, consider to reinstall Adobe Reader. First uninstall it and then reinstall.

    If this did not help then in the print dialog box, make sure the "Print to file" checkbox is not checked!

    Make sure that you have selected the right printer and try to preview before print see if it shows anything be it for printing?

    Have a look here

    https://www.Adobe.com/support/techdocs/333236.html

    Hope above can help,

  • Get the 'ads not this site' on Google Chrome.

    Original title: ads

    Hello

    I keep getting ads on Google Chrome (I tried others like Explorer still has on it) it only happened a few days ago, I think I have a virus, but I ran the Microsoft Safety Scanner on my laptop and it said: I have no one.  For example when I go on Google advertising gets down, under the search bar, and each ad to be on Twitter, YouTube and so on, it says 'ads not by this website '
    This never used to happen before, I think it was the Thursday he began to arrive, I have Norton since January, but I installed Microsoft Security Essentials today, believing they would disappear, as it's free, but they do not go far.
    I'd appreciate if someone answered and helped me sort this at once. Either incidentally, I tried these things in advertising blocker, and I did not, because they blocked the ad supported by the site, such as YouTube ads
    Thank you.

    Hey Jake,

    As you face the issue with Google chrome, you may need to change the settings in Google chrome itself.

    You might contact the support of Google chrome to get help.

    For more information, see the Google support link:

    Always get the 'ads not this site' not in chrome extensions

    Let us know if you need help with Windows related issues. We will be happy to help you.

  • I have CS5, I can't get the updates on this topic. When I try, I get an error saying that some updates could not be installed.

    I have CS5, I can't get the updates on this topic. When I try, I get an error saying that some updates could not be installed. I have uninstalled and reinstalled, tried several updates and called and chatted with adobe support. they sent me to you all. Can someone please help me update my CS5?

    update by downloading the files directly and then apply them:

    : http://www.adobe.com/downloads/updates/

  • What is the name of this query

    Hi all

    I want to know the name of this query to learn about it, because I don't understand how it works.

    Select the columns tab "(select table columns)" table.

    I saw him, but I don't know how it works.

    Thanks in advance

    It is a scalar subquery expression.

    "An expression of scalar subquery is a subquery that returns exactly one column of a line."

    The value of the scalar subquery expression is the value of the select item from the list of the subquery.

    If the subquery returns 0 rows, then the value of the scalar subquery expression is NULL.

    If the subquery returns more than one line, then Oracle returns an error. »

    See:

    http://docs.Oracle.com/CD/E16655_01/server.121/e17209/expressions013.htm#SQLRF52093

    For example, we can write

    Select empno,

    Ename,

    DEPTNO,

    (select dname dept where deptno = emp.deptno) dname

    WCP

    order by empno

    /

    Instead of

    Select e.empno,

    e.Ename,

    e.DEPTNO,

    d.DNAME

    from emp e,.

    d Dep.

    where e.deptno = d.deptno

    order by empno

    /

  • I BOUGHT "PHOTOSHOP ELEMENTS 14Lors I DOWNLOAD I GET"THE SIGNATURE OF THIS FILE IS CORRUPTED or not VALID"WHAT DO DO?

    I bought "photoshop elements 14. When I try to download it I get "the signature of this file is invalid or corrupted." What should I do?

    If you have a mac, How to open third-party developers not identified in Mac OS X applications ' Mac Tips .

Maybe you are looking for