On Mon, 2 Mar 2009, yaconsult wrote: > SQL newbie here.
Allow me to offer a recommendation rather than a solution to your problem. (I'd want more information on the attributes in each table before suggesting a SELECT statement.) Two books you should seriously consider purchasing are Rick van der Laan's "Introduction to SQL, 4th Ed." and Joe Celko's "SQL Programming Style." The former is the most comprehensive introduction to SQL I've ever seen, and has a great deal of information on time-based queries. The latter is a must read for anyone starting in SQL before they bring bad habits to their code. He discusses how to name things (and why), how to write portable SQL code, and how to organize data so a simple query (SELECT) will suffice rather than cobbling together a convoluted mess. If you'll be doing a lot of coding in SQL, take a look at Joe Celko's other books. He's been writing on database issues for more than a quarter century, and I remember reading his columns in DBMS Advisor in the mid-1980s. FWIW, he recommended van der Laan's book when I asked him for references for time-based queries. Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users