'*='
operator.
You guys is very helpful, thanks again :)
Erick Wellem
You could also try something like this:
SELECT client.name, IFNULL(COUNT(sales.sale_id), 0) AS total
FROM client LEFT JOIN sales ON client.client_id = sales.client_id
GROUP BY client.name
ORDER BY total DESC
The
it returns:
---
| client_name | total |
---
| John| 3 |
| Mark| 2 |
| Luke| 1 |
---
How can I have Matthew who does't purchase anything on the list?
Your help is much appreciated. Thanks.
Erick
}
// End function
//... Now the main program
$data=get_dbfield_data();
echo "Data Field : ".$data[0].", ".$data[1]."";
}
The Output:
Data Field : Data1, Data2
Thanks for inspiring reply John... :)
Best regards,
Erick Wellem
Wednesday, October 30, 2002,
r generous help...
--
Best regards,
Erick Wellem
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php