求一sql的linq的写法.该如何解决

求一sql的linq的写法.
原sql: 
select number from 表a 
where id=(select max(id) from 表a where titleType=1) 

能否写成 
var query = from q in a where XXX select XX;  
   
小弟感谢先哦!

------解决方案--------------------
假如你的数据库名石MyDB,这个数据库中有你要的表a,那么可以新建一个.dbml文件、
然后在代码中

MyDBDataContext myDBDataContext=new MyDBDataContext();
 var querys=from q in myDBDataContext.a
let m=(from l in myDBDataContext.a where l.titleType==1 select lid )
where q.id==m.max()
select q.number
------解决方案--------------------
这样写也可以的,试试 
比如:qDataContext db = new qDataContext(); 
var query=db.q.select(p=>p.id).where(p=>p.titleType==1 ).max()

用SQL语句写时,,强转一下,,用int定义别用var试试:int query=(from q in a 
where titleType=1 
select q.id).max();