Since you give no indication of the schema you are using:

Create table task (id integer primary key, ?.);
Create table todo ( task_id integer, day_no integer, foreign key (task_id) 
references task (id ) on delete cascade on update cascade  );
Create unique index todo_day on todo (day_no, task_id);
Create unique index todo_task on todo(task_id, day_no);

-- what to do on day x
Select task.* from todo join task on task.id = todo.task_id where todo.dayno = 
? [ORDER BY ?];

-- when to do task x
Select dayno from todo where task_id = ? [ORDER BY ?];

-- when to do which tasks that match
Select todo.dayno,task.* from task join todo on task.id = todo.task_id where ? 
[ORDER BY];


Von: Oskar Schneider [mailto:oskars93 at yahoo.com]
Gesendet: Mittwoch, 04. M?rz 2015 18:57
An: Hick Gunter
Betreff: Re: AW: [sqlite] Bitfield in Sqlite3-Table

With normalize you mean i should create a column for each integer-column for 
each bit?
What is the fastest approach for queries? (omit 1. since i don't want to use 
external software)

Hick Gunter <hick at scigames.at<mailto:hick at scigames.at>> schrieb am 17:19 
Mittwoch, 4.M?rz 2015:

In order of preference

a) use FastBit software
b) normalize your database design to eliminate the array
c) use a BLOB of 125 bytes and user defined functions to operate on them
d) use a string of 1000 characters ('0' or '1') and the SUBSTR() function

-----Urspr?ngliche Nachricht-----
Von: Oskar Schneider [mailto:oskars93 at yahoo.com<mailto:oskars93 at 
yahoo.com>]
Gesendet: Mittwoch, 04. M?rz 2015 16:42
An: sqlite-users at mailinglists.sqlite.org<mailto:sqlite-users at 
mailinglists.sqlite.org>
Betreff: [sqlite] Bitfield in Sqlite3-Table

Hello,
what is the best way to implement a Bitfield of size 1000 as a column in a 
Table. I need to make queries to select all rows which have the nth bit set?The 
bitfield describes for each day in about three years if a specific task needs 
to be done.

_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org<mailto:sqlite-users at 
mailinglists.sqlite.org>
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at<mailto:hick at scigames.at>

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.






___________________________________________
Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna,Austria
Tel: +43 1 80100 - 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.

Reply via email to