RSS | Archive | Random | E-mail

About

Hi, I'm Christian Castelli, a 28 years old italian programmer located in Pisa (Italy). Here I post small snippets of code which can be useful in my work.

Links

Codepuzzling main site
Development site
ByteStrike italian blog
Follow me on Twitter

My Life Style

while(passion) {
  try {
    myLife.run();
  }catch(LifeExceptions) {  
    stronger++;
    continue;
   }
}

Following

4 March 09

Which quotes have more than X services?

SELECT id, COUNT(productid) as numProd 
FROM `vtiger_inventoryproductrel`
WHERE id IN (SELECT quoteid FROM vtiger_quotes, vtiger_crmentity
                      WHERE quoteid = crmid AND deleted = 0)
GROUP BY id 
HAVING numProd > 4 

Tags: vtiger sql crm
Comments (View)
Themed by Hunson. Originally by Josh