Random Number Generation And Probability


Posted on 16th Feb 2014 07:03 pm by admin

Hello, I am working on a function which has to insert data into a SQL table.

we have to supply the function with number of entry needs to be inserted into the database and the work of the function is to insert the entry into SQL in such a way that 30% of the entry have their type(a column in my db) as 'a' , 20% as 'b' , 40% as 'c' and rest 10% as 'd'.

Did you know?Explore Trending and Topic pages for more stories like this.
Is there any way i can do this? Do I need to run 4 while loops?

Thanks.
No comments posted yet

Your Answer:

Login to answer
347 Like 54 Dislike
Previous forums Next forums
Other forums

Post, not working, please help
The error is:
Method Not Allowed
The requested method POST is not allowed for the URL /student

From Header Showing 'Unkown' In Hotmail? Why?
Code: $to = $row_GetID['email_addr'].',sales@mywebaddress.co.uk';
$subject = 'Thank you for you

ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Obj

preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the strin

Set Categories
I am creating a submission form for somebody to come in and submit products. These products are sep

natcasesort works on one server but not on another
Hi

I have a problem that I was hoping that someone can help me with.

I'm trying to use

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

media recovery
Hi,
i startup the database i got the error

SQL> startup
ORACLE instance started.

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash