Circular nesting related issues. Looks like it's not hard, bro, I'm so confused.

Source: Internet
Author: User
Loop nesting issues. It's not hard, I'm confused.
There are 4 categories of items:

Category 1: (I, II)
Category 2: (a,b,c,d)
Category 3: (a,b,c,d)
Category 4: (A, B, C, ding)

Want to achieve the following effect, how to cycle? How to build a table? A SQL statement seems to be a certainty, right?

One AA, one AB, one AC, one ad,

A A, a B, a-C, a-ding,

One ba, one BB, one BC, one BD,

A B, a B, a B-C, a B-ding,

One CA, one CB, one cc, one CD,

A C, a C, a C, a C ding,

One DA, one db, one DC, one DD,

A d A, a D B, a D C, a D-Ding,

A A, a B, a-C, a-ding,

A B, a B, a B-C, a B-ding,

A C, a C, a C, a C ding,

A d A, a D B, a D C, a D-Ding,

Two AA, two AB, two AC, two ad,

Bis A, two a B, two A, two a ding,

Two ba, two bb, two BC, two BD,

b, two B, two B, two B,

Two CAs, two CB, two cc, two CDs,

Two c A, two C B, two C, two C-butyl,

Two da, two db, two DC, two DD,

Two d, two D, B, D, B, D Ding,

Two A, two a B, two a C, two a ding,

b, two B, two B, two B,

Two c A, two C B, b c c, ii C Ding,

Two d, two D, B, D, B, D Ding,




------Solution--------------------
PHP Code
  
   
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.