Home > Net >  Statistics database in many fields
Statistics database in many fields

Time:10-02

The existing two tables, table 1 and table 2, respectively, two table field the same
Such as:
Table 1
A b c d type
100 10 10 20 1
100 10 10 20 1
100 10 10 20 2
100 10 10 20 2
100 10 10 20 3
100 10 10 20 3

Table 2
A b c d type
100 10 10 20 1
100 10 10 20 1
100 10 10 20 4
100 10 10 20 4
100 10 10 20 5
100 10 10 20 5


Constraint condition 1: table 1 and table 2 of the same type need to accumulate, accumulate may undertake, even after operations such as
Constraint condition 2: the number in the millions and millions of orders of magnitude, database is mysql
Constraint condition 3: need to statistical field has a, b, c, d, e, f... The multiple fields such as

Note: now in the discussion stage, send a post and everyone to discuss, look forward to have a different solution

Question: in the code for processing and using SQL stored procedure such as process which high efficiency? For example, please. Thank you all for the solver,

CodePudding user response:

Personally, I think the stored procedure is fast,

CodePudding user response:

Obviously a stored procedure is fast, the premise is the database server not too slag,
Millions of data, pulled out from the database alone drink a pot of enough,
  •  Tags:  
  • C#
  • Related