Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8516729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:30:43+00:00 2026-06-11T05:30:43+00:00

I’m working on a relatively simple query at this stage and I’m wondering how

  • 0

I’m working on a relatively simple query at this stage and I’m wondering how I can derive a single row of data when there is a change in column data (status). I know this sounds like jumble, I’m just not sure how to put it in correct terms so, I’m just going to show you!

I’m trying to extract the highest datestamp in column (whse_load_ts) where column (whse_ac) does not have a value of Y. I want this to return one row.

C_CLM   C_STA_CLM   WHSE_ACTN_CD    WHSE_CURR_ROW_IND   WHSE_LOAD_TS
12056733           AC                  U                     2012-05-30 03:18:12

Currently it is returning two rows because of the change in status c_sta_clm.

C_CLM     C_STA_CLM  WHSE_ACTN_CD   WHSE_CURR_ROW_IND         WHSE_LOAD_TS
12056733         AC             U                      2012-05-30 03:18:12
12056733         PC             U                      2012-04-28 03:19:38

All of the data for this specific claim looks like this:

 12056733   PC  I       2012-02-04 03:20:25.150
 12056733   PC  U       2012-02-07 03:19:43.230
 12056733   PC  U       2012-02-11 03:21:31.440
 12056733   PC  U       2012-04-28 03:19:38.380
 12056733   AC  U       2012-05-17 03:18:25.920
 12056733   AC  U       2012-05-19 03:20:33.200
 12056733   AC  U       2012-05-30 03:18:12.370
 12056733   TE  U   Y   2012-06-06 03:20:07.520

Query is as follows

SELECT 
    c_clm,
    c_sta_clm,
    whse_curr_row_ind,
    max(whse_load_ts) as "Loaded"
FROM 
    pearl_p.TLTC900_CLM_PRSST
WHERE 
    whse_curr_row_ind not in('y')
AND c_clm = '12056733'
group by 1,2,3

Basically it’s pulling the max date for each status AC/PC when i just want the max date for anything without a Y in the whse_curr_row_ind column

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:30:44+00:00Added an answer on June 11, 2026 at 5:30 am

    You can do this with a sub-query:

    SELECT 
        p1.c_clm,
        p1.c_sta_clm,
        p1.whse_curr_row_ind,
        p2.Loaded
    FROM pearl_p.TLTC900_CLM_PRSST p1
    INNER JOIN
    (
        select max(whse_load_ts) as Loaded, C_CLM
        from  pearl_p.TLTC900_CLM_PRSST
        where whse_curr_row_ind not in('y')
        group by C_CLM
    ) p2
        on p1.whse_load_ts = p2.Loaded
        and p1.C_CLM = p2.C_CLM
    WHERE p1.whse_curr_row_ind not in('y')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.