Home > database >  How not to repeat the data randomly selected from the database
How not to repeat the data randomly selected from the database

Time:09-17

Find the a heap of satisfy the conditions in the database data, such as 100, every time I get one, how is the only guarantee of data, in oracle

CodePudding user response:

Can put this article 100 the parties to a temporary table, took out the data using a field tag, the next time in filter! Simple and crude.

CodePudding user response:

With distinct on the cursor, a take a no

CodePudding user response:

Stored procedures to handle data, with the cursor directly,

Application processing data, to take to the program, the first is ok;

CodePudding user response:

Didn't quite understand demand, is upstairs said that mean?

CodePudding user response:

I speak it in more detail, demand is such, want to mobile phone users to business hall, a database, for example, there are 100 meet the conditions of a phone number, random points a to customers, before the number to take up other clerk number in from the database and also have chance to get to the same number, how to avoid or reduce the probability of as much as possible, not the other table, only operate according to the query results

CodePudding user response:

You don't say haven't understand again

CodePudding user response:

Article directly behind the query increase for update lock when the query, query else were you out of this article, until it is released

CodePudding user response:

Put out every random data set in the collection, taken when fetching data again took new data compared with the set in the collection of data, if not the same

CodePudding user response:

Is lower, at one point, the content of the storage has been extracted,
More advanced way to set a rule, to extract data according to the rules,

CodePudding user response:

Written according to the above, the query lock table can avoid this kind of situation, but others may want to wait
  • Related