i have a situation where i need to present a list of people in a table, and avoid duplicate entries.
my current steps are as follows:
//BEGIN
create temporary table tmpnames (name varchar(50));
insert into tmpnames (name) select ar1 from schedules where (ar1 is not null and ar1 <>'');
insert into tmpnames (name) select ar2 from schedules where (ar2 is not null and ar2 <>'');
insert into tmpnames (name) select referee from schedules where (referee is not null and referee <>'');
select distinct(name) from tmpnames where (name is not null and name <>'') group by name asc;
//END
when i run these things, i get a list which includes duplicates. the really odd thing is that some of the duplicates are removed, but not all. for instance, my name appears in the tmpnames table 3 times, but when i run the select statement my name is returned twice.
any ideas or tips would be greatly appreciated
thanks
green
my current steps are as follows:
//BEGIN
create temporary table tmpnames (name varchar(50));
insert into tmpnames (name) select ar1 from schedules where (ar1 is not null and ar1 <>'');
insert into tmpnames (name) select ar2 from schedules where (ar2 is not null and ar2 <>'');
insert into tmpnames (name) select referee from schedules where (referee is not null and referee <>'');
select distinct(name) from tmpnames where (name is not null and name <>'') group by name asc;
//END
when i run these things, i get a list which includes duplicates. the really odd thing is that some of the duplicates are removed, but not all. for instance, my name appears in the tmpnames table 3 times, but when i run the select statement my name is returned twice.
any ideas or tips would be greatly appreciated
thanks
green