Oracle Group takes the first piece of data

Source: Internet
Author: User

Look at the previous private log, the original has been a lot of small and simple problems have been confused!

Look at that time we are still novice novice to do memo notes!

In fact, it is using the statistical function of Oracle!

The previous diary (it should be the source of the previous company, hehe ...) ) as follows: Do not spray!

After grouping multiple data, take the first record of each group:

SELECT * FROM (select Row_number () over (PARTITION by Za40011_3.uriage_denpyo_no,za40011_3.uriage_denpyo_ro W_no ORDER by Za40011_3.kakutei_suryo_cs, ZA40011_3.KAKUTEI_SURYO_BL, za40011_3 .                KAKUTEI_SURYO_BT, Za40011_3.syukka_shiji_no, Za40011_3.syukka_shiji_row_no DESC) LEV,             Za40011_3. * from Wt_001_za40011_22070_2 za40011_2, Wt_001_za40011_22070_3 za40011_3, Jt_gyomu_uriage_detail uriage_detail WHERE za40011_2.kaisya_code = uriage_detail. Kaisya_code and za40011_2.uriage_denpyo_no = Uriage_detail. Uriage_denpyo_no and za40011_2.uriage_denpyo_row_no = Uriage_detail. Row_no and Uriage_detail. Kaisya_code = Za40011_3.kaisya_code and Uriage_detail. Uriage_denpyo_no = Za40011_3.uriage_denpyo_no and Uriage_detail. Row_no = Za40011_3.uriage_denpyo_row_no and Za40011_3.keppin_riyu_code are notNULL) WHERE LEV = ORDER by Kakutei_suryo_cs DESC 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.