Home > database >  Problems of SQL column sorting query, SQL beginners, consult a great god help!
Problems of SQL column sorting query, SQL beginners, consult a great god help!

Time:10-05

From the underlying table according to the condition of grouping query out two columns, c1 and c2, part of the content is as follows:

C1 and c2 respectively for the classification for the 3-2-2-2 and 3-2 coding (pictured above) for the part only, now to the query to get the following contents:

Dm rules for:
To heavy after ascending, c1 to classification according to the 3-2-2-2 classes displayed line by line, then the c2 meet c1, classified according to the 3-2 classes, according to the ascending line by line so on;
D1 rules for:
Dm belongs to c1 showed dm, c2 values for dm, displays c1 c2 values;
D2 rules for:
Dm belongs to c1 showed empty, c2 values for dm, display the c2 value,
For a great god, and for calling select dm from anywhere else, d1, d2 values, how to implement the results, the select
  • Related