Hi, I am trying to map every row in one table with a random row in another.
So for e.g. , for each network in 1 table I am trying to map random segments
from the other table. I have this sql below, but it always applies the same
random segment that it picks to all the rows for the network. I want each
row to have a random segment value. I'm just using the generate_series
function to generate id's as an e.g.
select id, seg_list from (select generate_series(1,10) as id) as X, (select
segment from segments order by random() limit 1 ) as Y
What I want is
I also tried
select generate_series(1,10), (select segment from segments order by
random() limit 1 )
View this message in context: http://postgresql.1045698.n5.nabble.com/map-row-in-one-table-with-random-row-in-another-table-tp5542231p5542231.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
pgsql-sql by date
|Next:||From: Adam Cornett||Date: 2012-03-07 18:28:28|
|Subject: Re-Sync Stand By Server|
|Previous:||From: Julien Rouhaud||Date: 2012-03-06 10:44:38|
|Subject: Re: [ADMIN] pg_dump : no tables were found.|