As per this link - http://xataface.com/wiki/sql_delegate_method I can create a function that uses __sql__ for table grafting. All works fine. However, I want to do it to 2 columns. I know I can't return more than once, but if I just create anotehr function __sql__ entry, it errors.
How can I have both columns grafted. i.e.
- Code: Select all
function __sql__(){
return "select c.*, s.TotalSites from Customers c left join CustomerStats s on c.CompanyName=s.CompanyName";
}
function __sql__(){
return "select c.*, s.TotalContracts from Customers c left join ContractStats s on c.CompanyName=s.CompanyName";
}
type of thing.
Cheers