Sort associated objects and associated objects

Source: Internet
Author: User

Sort associated objects and associated objects

1. Question Description:

Object A is associated with multiple objects B. You want to sort multiple associated objects B.

 

2. Solution:

2.1 A sorting field (such as ordernum) is required in the join relationship table. You can use the number of milliseconds in the current System time as the serial number (Long currentTimeMillis = System. currentTimeMillis ();). Because it is of the long type, there are different sizes.

2.2 When changing the order between multiple objects, such operations as moving and moving down are performed, the ordernum values of these objects can be exchanged.

2.3 sorting BY odernum (select a. * from asset a, objectgrouprobject ogro where a. ASSETID = OGRO. objectid and ogro. OGID = 20160401123045006 order by ogro. ORDERNUM)

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.