select user_name ,regist_Time,contact_name,company_phone,company_name from front_user where exists(select user_id,DAYOFMONTH(apply_time)as day from user_log where 1=1
#if($start_time &&!$start_time.equals(""))
and apply_time > '$start_time'
#end
#if($end_time &&!$end_time.equals(""))
and apply_time < '$end_time'
#end
group by user_id,DAYOFMONTH(apply_time)) ss group by day
我是想把user_log表中的userid 全取出来,跟frontuser表中的userid进行对比 ,讲相同userid的用户信息输出来,但是执行后并没有执行子查询中的,请问是为什么
#if($start_time &&!$start_time.equals(""))
and apply_time > '$start_time'
#end
#if($end_time &&!$end_time.equals(""))
and apply_time < '$end_time'
#end
group by user_id,DAYOFMONTH(apply_time)) ss group by day
我是想把user_log表中的userid 全取出来,跟frontuser表中的userid进行对比 ,讲相同userid的用户信息输出来,但是执行后并没有执行子查询中的,请问是为什么
//或者distinct(user_id)
//然后关联表查询,不知道是不是你想要的
select a.user_name,a.regist_Time,a.contact_name,a.company_phone,a.company_name from front_user a,
(select user_id from user_log where 1=1 and apply_time > '$start_time' and apply_time < '$end_time' group by user_id) ss
where a.user_id = ss.user_id
这个加上时间,可能没有数据的,两表关联可能没有结果。单独执行一次,有没有数据在看一下