Welcome Guest, Not a member yet? Register   Sign In
Want a Codeigniter Query
#2

PHP Code:
insert into t_category (categoryparent_category)
(
select t1.t_categoryt3.parent_id 
from t_csv t1
left join t_category t2 on t1
.category t2.category
left join t_pcategory t3 on t1
.parent_category t3.parent_category
where t2
.id is null and t3.parent_category is not null) as t5 
try this query, is shoul work.  

And read about  "correlated and non correlated query" , http://www.programmerinterview.com/index...-subquery/

your query is uncorrelated, thus its much slower than correlated ones, query above is correlated. when u have 100k > rows, using uncorrelated query may take hours to finish, where correlated ones may take 1-5mins
Reply


Messages In This Thread
Want a Codeigniter Query - by apysan - 03-22-2017, 12:45 AM
RE: Want a Codeigniter Query - by neuron - 03-22-2017, 01:33 AM
RE: Want a Codeigniter Query - by apysan - 03-23-2017, 12:12 AM
RE: Want a Codeigniter Query - by php_rocs - 03-28-2017, 08:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB