I have written a small article published in the new issue of the
SharePoint Advisor on executing CAML queries to retrieve data from lists and document libraries in SharePoint. It discusses the
SPQuery classs you have available in the current version and the new
SPSiteDataQuery class available with the new WSS v3. Besides this article, you will find plenty of other nice articles on SharePoint in the magazine.