Home Mysql table populated with binary table values
Reply: 0

Mysql table populated with binary table values

sarah_golf
1#
sarah_golf Published in 2018-02-14 17:35:22Z

Is there an easy way to generate a mysql table which is a binary table of a specified number of binary bits? Each row should have an Id column where the value equals the decimal value of the binary number, i.e.: 0,1,2,3,4,5....

for example say I specified 3 bits, the generated mysql table would look like this:

0   0 0 0

1   0 0 1

2   0 1 0

3   0 1 1

4   1 0 0

5   1 0 1

6   1 1 0

7   1 1 1

I would like to be able to just specify the number of binary bits and have it create a table and populate it appropriately depending on the number of bit required. Any ideas? I am wondering if there is a standard Sql function for this?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.328925 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO