Home > database >  Grouping SQL value problems
Grouping SQL value problems

Time:09-27

The order number number attribute
1838 product 1 1
1838 product 2 1
1838 product 3 1
1838 product 4 1
1763 product 1 2
1763 product 2 4
1839 product 1 1

To group for the same order number, take out 1 group contains products 2 (product code table there is a will) and there is no other product data

CodePudding user response:

Oh, too understand each problem,,

CodePudding user response:

Suggest you list your table structure, and provide the test data, and based on these test data that corresponds to the correct result,
Refer to the way the post questions http://bbs.csdn.net/topics/320211382

1. You create table XXX.. Statement
2. You insert into XXX... Statement
3. The result is what kind, and give a simple algorithm description)
4. Do you use the database name and version of (often asked in MS SQL server edition MySQL)

So people who want to help you to build the same environment with you directly, and in providing the test before, avoid the error in the text understanding,
  • Related