Let's say I have a table like this:

CREATE TABLE table1(
    id                INT,
    unit                INT,
    bit_position    INT,
    val                BOOL
);

INSERT INTO table1 VALUES(1,1, 0, 1);
INSERT INTO table1 VALUES(2,1, 1, 1);
INSERT INTO table1 VALUES(3,1, 4, 1);
INSERT INTO table1 VALUES(4,1, 7, 1);

INSERT INTO table1 VALUES(5,2, 0, 1);

The "bit_position" represent individual bits in bytes, and "val" represent if the bit should be set or clear (unit 1= 0b10010011, unit 2=0xb00000001 for the data in the above table).

How can I get the byte data in a single select instead of parsing through the individual bits one by one?

Requested select output example:
unit, byte
1, 147
2, 1


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to