Home > database >  How to realize the data extraction in two tables
How to realize the data extraction in two tables

Time:03-20

Recently met A problem, have A SQL data table (called A table), the data in A table of 120000 article, one of the column name is called "location", the whole data according to the column name already sorting, in accordance with requirements of the leadership, take the 120000 according to the location of the data is divided into A number of separate data table, I take only A location in A table value separately set up A new data table, called B was going to an A written statement: select * from A store where location="XXXXXXXXX" XXXXXXXXX copied from A B table, but the location of thousands of, this method is not feasible,

I wonder if I can use vernier's vision of A, B, cursor traverses the downward from the first data table, each data point to A stop, A table at this time the cursor from the first article data, as long as the location of the column of table data is equal to B cursor referred to in the current data, then this location as the name to create A new data table C, put A table of the current data extraction in table C, and so on, can be A separate data table CDEF... ,

I repeated test also didn't write to the statement, please god help or advice on a correct path,

Due to the data content and cannot be leaked out too much, so I can only use words to describe the problem,

Have to complete the work on Monday, if not so I had to a tearful wrote thousands of statements,

Currently, only 50 points, all their,
  • Related