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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:35:30+00:00 2026-06-12T14:35:30+00:00

The issue I face that I need after selecting multiple rows,to loop over each

  • 0

The issue I face that I need after selecting multiple rows,to loop over each row and fetch those who have some related information to the first row.

Example:

select NAME,ENGLISH_GRADE,FRANCE_GRAE
from (some complex query that have order by and returns 100 rows) WHOLE_ROWS
where

//Here I need to loop over WHOLE_ROWS and make something like that:
//if(currentRow.ENGLISH_GRADE==WHOLE_ROWS(0).ENGLISH_GRADE)
//fetch this row
  • 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-12T14:35:31+00:00Added an answer on June 12, 2026 at 2:35 pm

    Basically, you need to join your query to itself. You can do with with a subquery factoring clause:

    WITH complex_query AS
        ( ... complex query here ... ) 
    SELECT 
      FROM complex_query cq1
     WHERE cq1.english_grade = ( SELECT english_grade FROM cq1
                                  WHERE rownum = 1 )
    

    Here is a SQL Fiddle. You could also do this with analytics, but those seem to me more difficult to understand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have refereed old questions and found that people face many issues after installing
When I try to bottom-align text in a DIV element, I face the issue
Issue: RODBC (falsely) returning zero rows Situation: I'm using RODBC to connect to a
Issue for text elements that are adjacent to icon elements, the glyph height is
Issue is SOLVED: Problem is that it is a pre-compiled web page project and
I'm face to face with this issue, and I don't know how I can
I am using Eclipse Indigo for Android development. The problem i face is that
We have had an issue with a block of code that responds poorly in
I need to color the skin of the face... How do i find the
I have a null pointer on a button that I need to take me

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.