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 8200377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:25:41+00:00 2026-06-07T06:25:41+00:00

lets say we have a table BNK_ACCT_GRP_ST with these columns: Column Name ID Pk

  • 0

lets say we have a table BNK_ACCT_GRP_ST with these columns:

Column Name                          ID   Pk    Null? Data Type
BNK_ACCT_GRP_ST_ID1                  1          N     NUMBER (15)
BNK_ACCT_ID                          2          N     NUMBER (15)
BNK_ACCT_GRP_ID                      3          N     NUMBER (15)
BNK_ACCT_GRP_ST_CD                   4          N     NUMBER (4)
BNK_ACGRP_ST_SRC_EVNT_TYP_CD         8          N     NUMBER (4)
BNK_ACGRP_ST_SRC_TRAN_ID             9          N     NUMBER (15)
FNCL_GRP_ID                          10         N     NUMBER (15)
CREN_DT                              12         N     DATE
LAST_UPD_DT                          13         N     DATE
PCSG_DT                              14         N     DATE
BNK_ACCT_GRP_ST_SEQ_NO               15         N     NUMBER (15)

its populated with bnk_accts data :

example#1:

BNK_ACCT_GRP_ST_ID  BNK_ACCT_ID BNK_ACCT_GRP_ID BNK_ACCT_GRP_ST_CD BNK_ACGRP_ST_SRC_EVNT_TYP_CD FNCL_GRP_ID BNK_ACCT_GRP_ST_SEQ_NO
2282                150627009   1724            4                  150                          111111111   2
2283                150627009   1440            2                  149                          111111112   1
1908                150627009   1725            2                  134                          111111111   1
1906                150627009   1441            2                  135                          111111111   7

and example #2:

BNK_ACCT_GRP_ST_ID  BNK_ACCT_ID BNK_ACCT_GRP_ID BNK_ACCT_GRP_ST_CD BNK_ACGRP_ST_SRC_EVNT_TYP_CD FNCL_GRP_ID BNK_ACCT_GRP_ST_SEQ_NO
2364                150275031   1435            2                  114                          133333333   3
2365                150275031   1436            7                  116                          133333333   2
1902                150275031   1435            1                  72                           133333333   2
1903                150275031   1435            2                  36                           133333333   1
1904                150275031   1436            5                  74                           133333333   1

where:

  • BNK_ACCT_GRP_ST_ID is autoincrement field,
  • BNK_ACCT_ID is actualy bank account # id,
  • BNK_ACCT_GRP_ID is grp id (which always increasing),
  • BNK_ACCT_GRP_ST_CD, BNK_ACGRP_ST_SRC_EVNT_TYP_CD and BNK_ACGRP_ST_SRC_TRAN_ID are some id’s for trans purposes,
  • FNCL_GRP_ID – id of the bankiing insitution where this bank acc belongs to

what i need : to create a query to pull latest BNK_ACCT_GRP_ID for each BNK_ACCT_ID based on FNCL_GRP_ID. here one bank acc can belongs to one or more then one fncl instituion, so the query should return this output:

for example#1:

FNCL_GRP_ID  BNK_ACCT_ID  BNK_ACCT_GRP_ID
111111111    150627009    1725
111111112    150627009    1440

for example#2:

FNCL_GRP_ID  BNK_ACCT_ID  BNK_ACCT_GRP_ID
133333333    150275031    1436

I have tried a lot of the things lately, such as a combo of

(select distinct BNK_ACCT_ID,FNCL_GRP_ID) join to rank() over (partiton  by ) 

but with no luck.

  • 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-07T06:25:43+00:00Added an answer on June 7, 2026 at 6:25 am

    Try this:

    WITH BankData AS
    (
        SELECT  a.*, 
                ROW_NUMBER()
                  OVER(PARTITION BY fncl_grp_id, bnk_acct_id ORDER BY bnk_acct_grp_id DESC) AS Position
          FROM bnk_acct_grp_st a
    )
    SELECT  *
      FROM  BankData
     WHERE  Position = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have table named Place with columns: placeId int not null auto_increment,
Lets say i have a table with the following data Customer table: Name amount
Lets say I have a table with columns such as: ID Name City State
Lets say I have a table with just two columns: name and mood .
For examples sake, lets say I have a table containing these columns ID (primary
lets say I have a table named myPlayerInfo with following rows 'player name' 'number
Lets say I have table with following columns 1. Client - string. 2. Profit
Lets say we have a table here, populated with the following data: acc_id1 acc_id2
Lets say I have a table in MySQL called articles, that has a column
Lets say we have a table Names: ID Name Surname 1 Matt Smith 2

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.