You are here: Re: mysql query question « PHP Programming Language « IT news, forums, messages
Re: mysql query question

Posted by Bob Bedford on 04/25/06 23:07

Thanks for replying, Andy,

I've no access to any mysql newsgroup with my ISP, that's why I ask here.

Here is my query:

SELECT person.IDProprietary, FirstName, LastName,
DATE_FORMAT(StartDate,'%Y-%m-%d') as Datestartabo, abos.IDAbo,
billpro.IDBill, DateBill, AmountBill, SUM(paymentpro.AmountPayment) as
totalpayment from person inner join abos on person.IDProprietary =
abos.IDProprietary inner join typevendeur on person.IDTypeVendeur =
typevendeur.IDTypeVendeur left join billpro on abos.IDAbo = billpro.IDAbo
left join paymentpro on billpro.IDBill = paymentpro.IDBill WHERE
typevendeur.IDTypeVendeur > 1 group by paymentpro.IDPayment HAVING
AmountBill > totalpayment ORDER BY FirstName

the problem is that I've no result with "having AmountBill > totalpayment"
as there is no payment at all (I guess).

I'd like to have all records where the totalpayment < AmountBill but can't
figure out how. What's wrong with my query ?

Bob

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация