Conquer Club

Oracle/SQL help

\\OFF-TOPIC// conversations about everything that has nothing to do with Conquer Club.

Moderator: Community Team

Forum rules
Please read the Community Guidelines before posting.

Oracle/SQL help

Postby wicked on Thu May 18, 2006 12:06 pm

Anyone familiar with writing SQL scripts? Is there anyway I can get a random sample from a script? Right now, I'm spooling a huge list, exporting to excel and doing it there. Takes forever to generate the list, so was wondering if SQL could do it for me.

Thanks! 8)
User avatar
Major wicked
 
Posts: 15787
Joined: Thu Jan 26, 2006 1:23 pm

Postby Darkfire001 on Thu May 18, 2006 12:33 pm

When you say generate random sample, do you mean just pull some particular fields or a row out and generate it from that? There are a variety of ways, but an easy way would be just use "numrows" to find total rows, set that as the limit for a random number, and then pull a field based on the primary key. Thats a jiggy-rigged way to do it since if you have an incomplete dataset you'd have some issues, but thats the easiest method I can think of off the top of my head.
Lieutenant Darkfire001
 
Posts: 139
Joined: Mon Jan 23, 2006 4:37 pm
Location: Cary, NC

Postby wicked on Thu May 18, 2006 12:53 pm

I'm generating a huge list of ID numbers (thousands+) through a SQL script, of which I need to pull out 100 random ID's. I'm doing this for 6 different data sets. It's been spooling for about an hour now...LOL. I was hoping there was a way I could have sql pick 100 random ID's that meet set criteria w/o even generating the list (or so that I didn't have to see it and have it take hours). Make sense?

Thanks! :-)
User avatar
Major wicked
 
Posts: 15787
Joined: Thu Jan 26, 2006 1:23 pm

Postby wicked on Thu May 18, 2006 2:58 pm

nevermind, I found a way to limit my list another way ... thanks!
User avatar
Major wicked
 
Posts: 15787
Joined: Thu Jan 26, 2006 1:23 pm

Postby parno4u on Thu Dec 13, 2007 8:31 pm

bump
User avatar
Corporal 1st Class parno4u
 
Posts: 599
Joined: Fri Dec 22, 2006 6:55 pm
Location: Oklahoma

Postby ignotus on Fri Dec 14, 2007 3:46 am

parno4u wrote:bump


why?
heavycola wrote:
Snorri1234 wrote:Man, this thread was great. A whopping 230 pages with noone changing their viewpoint.


I actually converted around page 198. Unfortunately, I converted to satanism.
User avatar
Lieutenant ignotus
 
Posts: 2766
Joined: Thu Sep 06, 2007 9:34 am
Location: Hanging on to my old avatar.

Postby blackjoke on Fri Dec 14, 2007 9:05 pm

Out of curiosity did you limit your list length or find a way of getting a specific number of random selections?
Corporal 1st Class blackjoke
 
Posts: 5
Joined: Mon Dec 10, 2007 8:16 am

Postby wicked on Fri Dec 14, 2007 9:40 pm

I really don't remember. :lol: That was 1.5 years ago! :wink:
User avatar
Major wicked
 
Posts: 15787
Joined: Thu Jan 26, 2006 1:23 pm


Return to Practical Explanation about Next Life,

Who is online

Users browsing this forum: bigtoughralf, mookiemcgee