Hello there!
I need your suggestions, dear community.
I try to use a temporary table to remove duplicates from main table and compose such query:
Code:
create temporary table temp_comp
select count(companyname), companyname, companyid from company
group by companyname
order by companyid;
select * from temp_comp;
delete from company c_m where c_m.companyid not in (select t.companyid as cid from temp_comp t);
I get an error message trying this query to execute, it says I make mistake near of the (select t.companyid as cid from temp_comp t) clause. When I run it particularly it works fine. I use mysql version 4.0.16. Is it trouble of subquery using impossibility?