search

Home  >  Q&A  >  body text

java - How does Oracle obtain the next piece of data in a deduplication result set?

This is the query result in the oracle database:

SELECT DISTINCT(KS_ZKZ) FROM ZK.T_BYSQ_KS_KC ORDER BY KS_ZKZ ASC


I can now get a list of exam numbers:


Each student ID is a hyperlink connected to the detailed information of this student ID;

Now how can I jump to the next student number page by clicking the button on the detailed content page? For example, after I get the first student ID, how can I get the second student ID together?

为情所困为情所困2753 days ago543

reply all(4)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-17 10:06:31

    If you think about it carefully if you are working in Java or C#, list and details are two pages. The List data taken in the list function is released after the page rendering is completed, and cannot be used on the details page at all.

    select * 
    from ZK.T_BYSQ_KS_KC 
    where KS_ZKZ > ${当前准考证} and rownum = 1
    order by KS_ZKZ 
    

    reply
    0
  • 高洛峰

    高洛峰2017-05-17 10:06:31

    Why do you need to use sql to process it? Isn’t it very good to process it in Java, C#...

    reply
    0
  • 阿神

    阿神2017-05-17 10:06:31

    The student number selected in this way is the student number next to the current student number

    select ks_zkz, lead(ks_zkz) over (order by ks_zkz) as next from T_BYSQ_KS_KC

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-17 10:06:31

    select min(ks_zkz) from ZK.T_BYSQ_KS_KC where KS_ZKZ>${当前准考证}

    reply
    0
  • Cancelreply