mysql中,下面哪种查询效率比较高?
一:$notDealEmailArr=$elanw_client_caiji->getObjectList("selectcIdfromelanw_client_caij...
一:
$notDealEmailArr=$elanw_client_caiji->getObjectList("select cId from elanw_client_caiji where type=2 and addtime<='".$time."'");//审核未通过且14天以前的数据
foreach($notDealEmailArr as $k=>$v){
$cUser=$elanw_client->select('cId='.$v['cId'],'cUser');//获取业务员
$isUser=$userinf->select("name='".$cUser['cUser']."' and forbid<>'yes' and joinstate <>2",'name');//判断业务员是否是正式用户
if($isUser){
$updateArr= array(
array("columnName"=>"cUser","columnValue"=>'wbpub'),
);
$elanw_client->update($updateArr,"cId=".$v['cId']);//转入外部资源库
$updateArr2= array(
array("columnName"=>"type","columnValue"=>'0'),
);
$elanw_client_caiji->update($updateArr2,"cId=".$v['cId']);//审核状态变为待审核
}
}
二:
$idArr=$elanw_client->getList('allList', "and cId in(select cId from elanw_client_caiji where type=2 and addtime<='$time') and cUser in(select name from userinf where forbid<>'yes' and joinstate <>2)",'','', '', array('fields'=>'cId'),'');//获取14天前审核不通过的且已被领取的数据
foreach($idArr as $k=>$v){
$updateArr= array(
array("columnName"=>"cUser","columnValue"=>'wbpub'),
);
$elanw_client->update($updateArr,"cId=".$v['cId']);//转入外部资源库
$updateArr2= array(
array("columnName"=>"type","columnValue"=>'0'),
);
$elanw_client_caiji->update($updateArr2,"cId=".$v['cId']);//审核状态变为待审核
}
直接说下面哪种查询比较好啊
法一:
$A=query(select name from tableA where id in(select id from tableB where logintime<='2016-04-21 14:20:00'));
法二:
$B=query(select id from tableB where logintime<='2016-04-21 14:20:00');
foreach($B as $v){
$C=query(select name from tableA where id=$v['id']);
} 展开
$notDealEmailArr=$elanw_client_caiji->getObjectList("select cId from elanw_client_caiji where type=2 and addtime<='".$time."'");//审核未通过且14天以前的数据
foreach($notDealEmailArr as $k=>$v){
$cUser=$elanw_client->select('cId='.$v['cId'],'cUser');//获取业务员
$isUser=$userinf->select("name='".$cUser['cUser']."' and forbid<>'yes' and joinstate <>2",'name');//判断业务员是否是正式用户
if($isUser){
$updateArr= array(
array("columnName"=>"cUser","columnValue"=>'wbpub'),
);
$elanw_client->update($updateArr,"cId=".$v['cId']);//转入外部资源库
$updateArr2= array(
array("columnName"=>"type","columnValue"=>'0'),
);
$elanw_client_caiji->update($updateArr2,"cId=".$v['cId']);//审核状态变为待审核
}
}
二:
$idArr=$elanw_client->getList('allList', "and cId in(select cId from elanw_client_caiji where type=2 and addtime<='$time') and cUser in(select name from userinf where forbid<>'yes' and joinstate <>2)",'','', '', array('fields'=>'cId'),'');//获取14天前审核不通过的且已被领取的数据
foreach($idArr as $k=>$v){
$updateArr= array(
array("columnName"=>"cUser","columnValue"=>'wbpub'),
);
$elanw_client->update($updateArr,"cId=".$v['cId']);//转入外部资源库
$updateArr2= array(
array("columnName"=>"type","columnValue"=>'0'),
);
$elanw_client_caiji->update($updateArr2,"cId=".$v['cId']);//审核状态变为待审核
}
直接说下面哪种查询比较好啊
法一:
$A=query(select name from tableA where id in(select id from tableB where logintime<='2016-04-21 14:20:00'));
法二:
$B=query(select id from tableB where logintime<='2016-04-21 14:20:00');
foreach($B as $v){
$C=query(select name from tableA where id=$v['id']);
} 展开
2个回答
今至电子科技有限公司
2024-08-23 广告
2024-08-23 广告
数据库备份是确保数据安全与业务连续性的关键环节。我们上海今至电子科技有限公司高度重视数据保护,定期执行全面的数据库备份策略。这包括使用先进工具和技术,对关键业务数据进行自动化备份,并存储在安全可靠的外部存储介质或云端。通过定期验证备份的完整...
点击进入详情页
本回答由今至电子科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询