General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Dustin,
For a book try SQL For Smarties (SEcond Edition) by Joe Celko.
Joe can be found on comp.databases.ms-sqlserver and microsoft.public.sqlserver.programming. Questions like yours are pretty platform independent so you could post either of those places.
If you want to learn SQL, read everything Celko posts, and on the MS VFP newsgroups, read everything that Anders Altberg posts.
>I hope some of the SQL gurus here can get me on the right track. How do I write a view that does this:
>
>If I had a CITIES table, with a 1-to-many relationship with TEMPERATURE table. TEMPERATURE simply contains a Temperature, a Date, and of course the CITY's ID. For fun, let's say I've entered in one record for each city, each day, for the last 2 years. (So after 2 years, each city would have 730 TEMPERATURE records)
>
>How would I write a view that would return the all-time high temperature for each city? (If I had 250 cities, I'd want 250 records sent back,.... one for each city)
>Simplest format: CITY NAME, TEMP, DATE.
>
>
>2nd question: what resources could you refer me to that would help me out with SQL statements like the one I wrote above? I'm not really interested in a SQL Bible, but more like what an Algorithm Book would do for a coder.... examples of how to do this weird thing, examples of how to do that,etc. The Vfp Help/MSDN seems to be really lacking. They had a good start, and attempted to show examples of each command, but not how to mix it up, use subqueries, etc.
>
>Thanks,
>Dustin
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only