常写的一些sql语句

来源:互联网 发布:十禾淘宝运营怎么样 编辑:程序博客网 时间:2024/06/03 00:14
select b.entpName,b.innerID,a._id from android_insRecord a,android_pucEntp b where 1=1 and b.innerID in(select c.innerID from android_govTroubleRegCheck c where c.innerID in(select d.innerID from android_govCheckInspectCheckContent d where d.troubleType=1)) and b.entpName like '%%' order by a.savetime desc


//提出重复
//select distinct  _id,innerId,(select entpName From android_pucEntp c where c.innerID=a.innerId) entpName from


select distinct  _id,innerId,(select entpName From android_pucEntp c where c.innerID=a.innerId) entpName from(select b._id,a._id,a.innerId,(select entpName From android_pucEntp c where c.innerID=a.innerId) entpName,b.checkUnit,c._id troubleId,a.entpTypeId,a.checkItemId,c.improveStep,c.improveUnit,c.finishDate,c.closeFlag,c.checkDate from android_govCheckInspectCheckContent a ,android_insRecord b,android_govtroubleregcheck c where a.inspectID=b._ID  and a._id=c.inspectId and a.troubleType=1 order by b.savetime desc )a
0 0