"M. A. Alves" wrote:
> I think the problem is in your query expression. I have reformulated your
> original query using my style and that consistently results in 4 rows
> which I think is what you wanted.
>
> Original_Query : String :=
> "select distinct Exhibition.InternalNumber,Exhibition.Name,"&
> "Exhibition.Openning,Exhibition.Closure,Exhibition.Schedule,"&
> "Country.Name,City.Name,ExhibitionHall.Name,Exhibition.AdressPhones,"&
>
> "Exhibition.ExhibitionURL,Exhibition.Organizer,Exhibition.OrganizerPhoneFax,"&
> "Exhibition.OrganizerURL,Exhibition.Logo,Exhibition.Description from "&
> "ExhibitionTopic left join Exhibition on ExhibitionTopic.Exhibition="&
> "Exhibition.InternalNumber left join ExhibitionHall on
> Exhibition.Hall="&
> "Exhibition.InternalNumber left join City on
> ExhibitionHall.City=City."&
> "InternalNumber left join Country on
> City.Country=Country.InternalNumber";
>
> My_Style : String :=
> "select " &
> "distinct e.InternalNumber, " &
> "e.Name, " &
> "e.Openning, " &
> "e.Closure, " &
> "e.Schedule, " &
> "co.Name, " &
> "ci.Name, " &
> "eh.Name, " &
> "e.AdressPhones, " &
> "e.ExhibitionURL, " &
> "e.Organizer, " &
> "e.OrganizerPhoneFax, " &
> "e.OrganizerURL, " &
> "e.Logo, " &
> "e.Description " &
> "from " &
> "Exhibition e, " &
> "ExhibitionHall eh, " &
> "Country co, " &
> "City ci " &
> "where " &
> "eh.InternalNumber = e.Hall and " &
> "ci.InternalNumber = eh.City and " &
> "co.InternalNumber = ci.Country";
>
> Also, your database scheme does not seem to be normalised. In your scheme
> an Exhibition has a City, a Hall and a Country, but the dependencies exist
> Hall -> City
> City -> Country
> no?
>
that's an old reflex
I prefer to hold straight links as well as canonical hierarchical - for sppeding
up group selects
But you forgot ExhibitionTopics table - they are involved in some case of
filtering.
So you mean to replace joining with combined condition?
---------------------------------------------------------------------
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