Bin function for set : BIN « Function « SQL / MySQL






Bin function for set

      
mysql>
mysql> CREATE TABLE SERIES_NUMBERS
    ->       (NUMBERS SET
    ->           ('1','2','3','4','5','6','7','8','9','10',
    ->            '11','12','13','14','15','16','17','18','19','20',
    ->            '21','22','23','24','25','26','27','28','29','30',
    ->            '31','32','33','34','35','36','37','38','39','40'));
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> INSERT INTO SERIES_NUMBERS VALUES ('1'),('20'),('40');
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql>
mysql> SELECT    NUMBERS, BIN(NUMBERS * 1)
    -> FROM      SERIES_NUMBERS;
+---------+------------------------------------------+
| NUMBERS | BIN(NUMBERS * 1)                         |
+---------+------------------------------------------+
| 1       | 1                                        |
| 20      | 10000000000000000000                     |
| 40      | 1000000000000000000000000000000000000000 |
+---------+------------------------------------------+
3 rows in set (0.00 sec)

mysql>
mysql>
mysql> drop table SERIES_NUMBERS;
Query OK, 0 rows affected (0.00 sec)

   
    
    
    
    
    
  








Related examples in the same category

1.Check the set value by bin