[Vtigercrm-developers] OFFTOPIC mysql question

Prasad prasad at vtiger.com
Tue Feb 17 00:43:16 PST 2009


Hi David,

I would suggest to take a 2 tier approach

* SELECT customers.cid FROM customers

* For each of the customers get the last order details

SELECT orders.oid, customers.email FROM orders INNER JOIN customers on
customers.cid = orders.cid ORDER BY orders.orderdate DESC LIMIT 1

Regards,
Prasad
vtiger Team

On 2/14/09, David fire <ddfire at gmail.com> wrote:
>
> hi
> this is an off topic sorry.
>
> i have 3 tables
>
> orders:
> oid,cid,orderdate
>
> customers:
> cid,email,name
>
> splits:
> oid,quantity,ordprodisize
>
> cid= uctomer id.
> oid= order id.
>
> i need to pick the last order of each customer before a date for example
> 2008-10-01
> and the emal and the quantity,
>
> please help.
>
>
>
> if you help me i will be abel to finish to modules for vtiger.
> a web soft phone.
> and a module creator, yes a module to make new modules nice ;-)
>
> David
>
>
> --
> (\__/)
> (='.'=)This is Bunny. Copy and paste bunny into your
> (")_(")signature to help him gain world domination.
>
>
> _______________________________________________
> Reach hundreds of potential candidates - http://jobs.vtiger.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20090217/05a41d04/attachment-0003.html 


More information about the vtigercrm-developers mailing list