Hi Chip,

> Thanks for the tips. So here's my latest attemp:
>
> select distinct Title, Details, StartDate, StopDate, City, State
> from phpCalendar_Details t1, phpCalendar_Daily t2, phpCalendar_EventLocations t3
> where t1.LocationID = t2.LocationID
> and t1.EventLocationID = t3.EventLocationID
> group by StartDate;
>
> And this one works!  Amazing, my first attempt at a join statement.


=it works, great! Join our happy throng of MySQL-ers!

but...
(I'm going to make loads of assumptions because you have changed the schema of two or 
even all three of the
involved tables (since describing them before) - it works, so that's not bothering me)
What is?
1 why use DISTINCT?
ie what do you think it is contributing to the query result?
2 why use GROUP BY?
ie what do you want to happen if there is more than one event starting on the same 
date?

Yes relational algebra can be fun - provided you didn't sleep through set theory etc 
at school. Congratulations
on your success, that is an "inner join" and in fact is also a "equi-join" (and 
there's plenty of other jargon
that you can use to describe it). Your first example had a join in its WHERE clause 
too - did you mean that this
is your first multi-way join? Now is the time when all good (wo)men go out and pick up 
a decent text and get
stuck in...

Regards,
=dn



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to