C#SQL联合查询 关联查询!!

select * from 文章列表 t1 left join 栏目 t2  on t1.栏目id= t2.id  where   t2.下载积分>'0' and (t1.时间 between '1990-01-01 00:00:00' and '" + DateTime.Now.ToString("yyyy-MM-dd 23:59:59") + "') and (t1.标题 like '%" + woguanjianci.Text + "%'  )  order by t1.ID desc




select  top 10  * from 文章列表 t1 left join 栏目 t2  on t1.栏目id= t2.id  where  t2.下载积分='0' and  (t1.时间 between '1990-01-01 00:00:00' and '" + DateTime.Now.ToString("yyyy-MM-dd 23:59:59") + "')  order by t1.ID desc





select top 8 * , NewID() as random  from 文章列表 t1 left join 栏目 t2 on  t1.栏目ID = t2.id  where (t1.标题 like '%" + DropDownList1.Items[0].Text + "%' or t1.标题 like '%" + DropDownList1.Items[1].Text + "%') and (t2.下载积分='0' )  order by newid()





三个都差不到  


联合查询   积分大于0  时间段范围内  模糊关键词




webform
桂ICP备16004754号