> $sql_select_policy =
> 'SELECT *, user.id'.
> ' FROM (SELECT 1 as id, 99 as policy_id, 1 as priority'.
> ' FROM domain WHERE CONCAT("@",domain_name) IN (%k)'.
> ' ORDER BY priority DESC) AS user'.
> ' LEFT JOIN policy ON policy_id=policy.id';
Actually in this last example the sort is redundant,
as all records are of the same type (just a domain name)
and have the same priority, so it boils down to:
$sql_select_policy =
'SELECT *, user.id'.
' FROM (SELECT 1 as id, 99 as policy_id FROM domain'.
' WHERE CONCAT("@",domain_name) IN (%k)) AS user'.
' LEFT JOIN policy ON policy_id=policy.id';
Mark
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/