All pastes #922767 Raw Edit

Miscellany

public text v1 · immutable
#922767 ·published 2008-02-29 00:38 UTC
rendered paste body

create table test.tmp_is_primary_phone ( id integer unsigned );
insert into test.tmp_is_primary_phone select min(id) from civicrm_phone where is_primary = 1 group by contact_id ;
update civicrm_phone set is_primary = 0 where id not in ( select id from test.tmp_is_primary_phone ) ;
drop table test.tmp_is_primary_phone ;