I am trying to update my SQL table with 0 and 1. I have design a code that enables me to read sql table and write the result to text file. The problem is that i would like to convert 0 values to 1 randomly based on percent. For example, assume that table A is columns *4 rows with values 0 and 1.
The current percentage of 1 is 6/16. which is %37.5 I would like to increase the current percentage to 50%. To do so i need to convert randomly additional two 0s to 1 to get the total 8 of values 1. I appreciate your assistant in advance.
For example:
Table A
a1 a2 a3 ... am
1 0 0 1 ... 1
2 0 1 0 ... 0
3 0 0 1 ... 0
4 1 1 0 0
...
n
1
Expert's answer
2011-04-13T11:46:22-0400
Submit your question as an assignment to our control panel set the deadline and our programmers will assist you.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment