View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 09:33 AM
Peter H. Coffin
 
Posts: n/a
Default Re: How to join several MySQL tables

On 12 Nov 2006 06:51:38 -0800, Stefan Mueller wrote:
> $db_query = "SELECT * FROM joined-table ORDER BY entry12 ASC, entry22
> ASC, entry23 ASC, entry34 DESC, entry42 ASC, entry43 ASC";
>
> Is that correct and if yes, how can I join these 4 tables?
> Will this joined table only be available in the memory? If yes, how
> long will this joined table be available in the memory?


http://dev.mysql.com/doc/refman/5.0/en/join.html

The join lasts as long as the query runs. Don't worry about that being
short-lived. Joining is the core reason for Relational Databases to
exist, so joining is very fast if an appropriate index is available.
Worry about what kind of index is available only after your query has
become unacceptably slow.

--
12. One of my advisors will be an average five-year-old child. Any flaws in my
plan that he is able to spot will be corrected before implementation.
--Peter Anspach's list of things to do as an Evil Overlord
Reply With Quote