Re: Oracle to PGSQL -- need help
От | Masaru Sugawara |
---|---|
Тема | Re: Oracle to PGSQL -- need help |
Дата | |
Msg-id | 20020726223411.C8F4.RK73@sea.plala.or.jp обсуждение исходный текст |
Ответ на | Oracle to PGSQL -- need help ("Randall Barber" <rdb55@email.byu.edu>) |
Ответы |
Re: Oracle to PGSQL -- need help
|
Список | pgsql-general |
On Thu, 25 Jul 2002 15:17:08 -0600 Randall Barber <rdb55@email.byu.edu> wrote: > I greatly appreciate your time and help--I have not yet tried to implement > what you gave me, but here is some additional explanation: > > ABS(MOD(DBMS_RANDOM.RANDOM, 100)) > > This generates a random number between between +/- 2^32. I use the MOD to > keep the number with a range (0-100) and an ABS to make it positive > regardless. The idea is to pick a random row out of information that shares > a common value. In your example, you list everything in the table, but > without much changing I think I can make it so that the result brings back a > single row instead of multiple. Just needs a where clause in one of the > SELECTs :). Thank you for your explanation. I were roughly able to figure out the whole process you thought. But there are some columns I don't know; actually their names don't appear in either of this mail and prior mail. Could you tell me the answer to the following questions ? 1. Does "a common value" mean one of the values that Q column has? 2. Does "a range (0-100)" mean the fact that the range is always 0 to 100 ? Doesn't the range depend on the number of the rows that share a selected value ? >> Given an insert request, I want the trigger to find out which # is used on >> the left, and then randomly select one of the resultant rows and insert the >> randomly picked row's PKEY value along with the original insertion info. >> into a third table. 3. What table is "a request" inserted into ? 4. What column is "PKEY" created on ? >> Q, JOBID >> -------- >> 1,2 >> 1,5 >> 1,200 >> 1,4356 >> 1,483 4. Is this a second table ? Regards, Masaru Sugawara
В списке pgsql-general по дате отправления: