[odb-users] 2-table query
MM
finjulhich at gmail.com
Sun Sep 6 17:19:34 EDT 2015
Hello,
I have the following 2 tables and their relevant columns:
M
==
id: PRIMARY KEY
month1: TEXT (encoded month,year combination)
month2: TEXT
F
==
id: PRIMARY KEY
mid: NOT NULL REFERENCES M("id")
month: TEXT
There can 0..N rows in F for each row in M.
My question is two-fold:
1. How do I select all the F rows such that their month is 1 of the
2months in the relevant M row (the one where F.mid=M.id)?
2. How do I express this with an odb:query? Both M and F tables are the
mapping of c++ classes.
db is sqlite. F has about 100 000 rows. The result of the query is about
200.
Thanks,
MM
More information about the odb-users
mailing list