Oracle sorts the first data

Source: Internet
Author: User


In Oracle sorting, the first data entry needs to update the large unit of the set group. The rule is to obtain the unit information of the first student (minimum set ID. Sort by SUITEID to obtain the first method. Www.2cto.com SQL code UPDATE sim_big_suite u SET u.org _ code = (SELECT SUBSTR (x. pilot_unit, 1, 4) FROM (SELECT n. * FROM sim_student_assign n WHERE n. big_suite_no = 192 AND -- u. big_suite_no = n. big_suite_no AND n. ac_type_code = 14 AND n. fixed_year = '2017 first half 'AND n. train_com = 1001 AND n. position = 'l' order by n. suite_id) x where rownum = 1) WHERE u. ac_type_code = 14 AND u. fixed_year = '2017 first half 'AND u. train_com = 1001;

Related Article

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.