if you were to use php to do it that way, it might look something like this:
PHP Code:
<?
$contacts = array();
$result = mysql_query("select * from table where location1='london'");
while ($row = mysql_fetch_assoc) {
$contacts[] = $row;
}
$result = mysql_query("select * from table where location2='london' AND location1 != 'london");
while ($row = mysql_fetch_assoc) {
$contacts[] = $row;
}
$result = mysql_query("select * from table where location3='london' AND location1 != 'london" AND location2 != 'london');
while ($row = mysql_fetch_assoc) {
$contacts[] = $row;
}
// then maybe some more logic to check for duplicates
?>