|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Select Statement
From: Sebastian Mendel (lists
sebastianmendel.de)
Date: Mon Mar 10 2008 - 07:57:25 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Velen schrieb:
> Hi,
>
> I need to write up a select statement something like:
>
> Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where
> a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept
> between $tring1 and $tring2. group by supcode
>
> This is fine but the problem is that there is duplicate supcode in a.
>
> When running this query I often have c values which does not relate to
> supcode.
yes, because c is JOINED by `code` and not by `subcode` with a "and
a.code=c.code"
--
Sebastian
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]