List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 2 2000 12:13am
Subject:Re: Manual error?
View as plain text  
At 2:38 PM -0700 2000-06-30, Dennis Gearon wrote:
>The ',' in the line that reads "from order,customer" should be a '.'
>correct?

No, that indicates a join, that is, a select that pulls rows from
two different tables (order and customer).  The rows are matched
by comparing the custid column in each table and the matching
rows are used to create the result set.


>//----------------------------------------------------------------------------------
>
>MySQL has extended the use of GROUP BY. You can use columns or
>calculations in the SELECT
>expressions which don't appear in the GROUP BY part. This stands for any
>possible value for this group.
>You can use this to get better performance by avoiding sorting and
>grouping on unnecessary items. For
>example, you don't need to group on customer.name in the following
>query:
>
>mysql> select order.custid,customer.name,max(payments)
>        from order,customer
>        where order.custid = customer.custid
>        GROUP BY order.custid;
>
>In ANSI SQL, you would have to add customer.name to the GROUP BY clause.
>In MySQL, the name is
>redundant if you don't run in ANSI mode.
>//----------------------------------------------------------------------------------
>
>
>
>--
>________________________________________________________________
>Dennis K. Gearon (Kegley)
>Scientific Instrument Technician, School of EIT
>Oregon Institute of Technology - One of USA's 100 Best College Buys
>3201 Campus Drive
>Klamath Falls, OR 97601
>Voice   1-541-885-1563
>FAX     1-541-885-1689
>email   gearond@stripped
>________________________________________________________________
>Happiness is when you want to go to your job in the morning and
>when you want to go home in the evening.
>________________________________________________________________
>
>
>
>--
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/php/manual.php3" before
>posting. To request this thread, e-mail mysql-thread42308@stripped
>
>To unsubscribe, send a message to:
>     <mysql-unsubscribe-paul=snake.net@stripped>


-- 
Paul DuBois, paul@stripped
Thread
Manual error?Dennis Gearon1 Jul
  • Re: Manual error?Paul DuBois2 Jul