SQL Language (MOSC)

MOSC Banner

SQL Selecting Records using comparison condition

edited Aug 22, 2017 4:03PM in SQL Language (MOSC) 8 commentsAnswered ✓

Hello Guru,

I am still a newbie and have a SQL Question with below data

create table XXTEST1 (DOCNBR number(10),QTY number(10),BALANCE number(10));

insert into XXTEST1 (DOCNBR,QTY,BALANCE) values (973740,111,111);

insert into XXTEST1 (DOCNBR,QTY,BALANCE) values (973754,140,251);

insert into XXTEST1 (DOCNBR,QTY,BALANCE) values (973793,140,391);

insert into XXTEST1 (DOCNBR,QTY,BALANCE) values (973827,140,531);

insert into XXTEST1 (DOCNBR,QTY,BALANCE) values (973860,140,671);

insert into XXTEST1 (DOCNBR,QTY,BALANCE) values (1018097,500,1171);

DOCNBR is ID of the document, Qty and Balance is a running balance (current qty record + qty from previous record).

Output that I expect is I want to see the first record that having > 250 and all records that less than 250. for above sample, we should see

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center