例如先用循环产生一批随机数并存入数据表中,再用
select distinct colName from tableName
选出无重复的随机数予以应用
select distinct(phome_ecms_dp.id), phome_ecms_dp.*,phome_zzz_dianping.* from phome_ecms_dp INNER JOIN phome_zzz_dianping on phome_zzz_dianping.yid=phome_ecms_dp.id where phome_zzz_dianping.shenhe=1 and phome_zzz_dianping.pltitle!='' and length(phome_zzz_dianping.haoping)>30 and length(phome_zzz_dianping.chaping)>30 and length(phome_zzz_dianping.zongjie)>30 ORDER BY phome_ecms_dp.id DESC LIMIT 1 , 20or
select phome_ecms_dp.*,phome_zzz_dianping.* from phome_ecms_dp INNER JOIN phome_zzz_dianping on phome_zzz_dianping.yid=phome_ecms_dp.id where phome_zzz_dianping.shenhe=1 and phome_zzz_dianping.pltitle!='' and length(phome_zzz_dianping.haoping)>30 and length(phome_zzz_dianping.chaping)>30 and length(phome_zzz_dianping.zongjie)>30 group by phome_ecms_dp.id ORDER BY phome_ecms_dp.id DESC LIMIT 1 , 20
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)