SQLite Forum

SELECT question
Login
Appreciate your experience in this matter. It has also been on my radar to 'fix' that situation.
The way I handle multiple docs by the same author is to increment the docid for that author. I do have an 'authors' table
<pre>
CREATE TABLE authors (
id integer not null primary key autoincrement,
author text,
authorid integer,
docid integer);
</pre>
so essentially the same as your suggestion without the linkage tables. That's what I'm using authorid and docid for. Some typical Perl code:
<pre>
$sth=$dbh->prepare(qq{select title,docs.authorid,docs.docid,pubyear,source,filename,author,
(
select group_concat(keyword)
from keywords
where keywords.docid = docs.docid
and keywords.authorid = docs.authorid
)
from docs
order by docs.id desc limit 5});
</pre>
Now that I have this situation solved I can work on 'normalizing' the rest of the DB and any tweaking.
Thank you for your experience.