retriving rows from database with out duplication
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Karthik_Pushparaj
Posted On:   Wednesday, March 5, 2003 09:11 PM

hi all,

i am developing a small application in java involving jdbc.the database is in ms access in table i have 3 fields namely id(primary key), question,answers,i want to randomly select 10 rows from entire data base without duplication of row. i want to populate the values in a grid.
any sugessions are welcome thank u in advance.

Re: retriving rows from database with out duplication

Posted By:   rajeev_kumar  
Posted On:   Friday, March 7, 2003 09:22 AM

select distinct count(10) query

Re: retriving rows from database with out duplication

Posted By:   Anonymous  
Posted On:   Thursday, March 6, 2003 01:56 AM

Hi,

I'm sure there are a number of different possable ways. My thought would be to load the database into a vector. Then in a "for" (or other) loop, make random selections from that vector (ie. int (randomnumber* vectorlength)) and move selections from the first vector to a second vector.

J. Smith

Aylmer, PQ

About | Sitemap | Contact