Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012
    Posts
    1

    Unanswered: select max date help

    I'm trying to get this query to work. so far I keep getting the error "FROM keyword not found where expected"
    Please help!

    select
    o.PRODUCT_VERSION,
    o.ORDER_TYPE,
    o.ORDER_VERSION_STATUS,
    o.ORDER_COMPLETE_DATE,
    p.TN_NPA,
    p.TN_NXX,
    p.TN_LINENO,
    FROM
    (SELECT *,TN_NPA || TN_NXX || TN_LINENO as PhoneNumber
    FROM OMS_ORDER) o
    INNER JOIN (SELECT TN_NPA || TN_NXX || TN_LINENO as PhoneNumber, max(ORDER_COMPLETE_DATE) as max_compldt
    FROM CUAPPO.OMS_ORDER
    GROUP BY TN_NPA || TN_NXX || TN_LINENO || ) o1
    ON o1.PhoneNumber = o.PhoneNumber
    AND o1.max_compldt = o.ORDER_COMPLETE_DATE
    INNER JOIN CUAPPO.OMS_PRODUCT_VERSION p
    ON p.PRODUCT_VERSION = o.PRODUCT_VERSION
    where
    o.ORDER_TYPE = 'CU'

  2. #2
    Join Date
    Jan 2012
    Posts
    84
    Code:
    ....
    p.TN_LINENO,
    FROM
    ....
    erase the comma, oracle expects another expression (column name) after the comma.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •