我的HQL语句:
select count(*) from (select new RelevanceVide(r.resId,r.title,v.duration,v.bitrate,v.videoCodec,v.audioCodec) from Resource r,ResVideo v where r.resId = v.resId);hql语句中不支持 select ...from(select...)这样的语句!~~~我要查出原来的结果不变,该怎么改这SQL啊!
select count(*) from (select new RelevanceVide(r.resId,r.title,v.duration,v.bitrate,v.videoCodec,v.audioCodec) from Resource r,ResVideo v where r.resId = v.resId);hql语句中不支持 select ...from(select...)这样的语句!~~~我要查出原来的结果不变,该怎么改这SQL啊!
解决方案 »
- jxl合并单元格,读该合并之后的单元格,读出数据出现与单元格数据不一致问题,请熟悉jxl的兄弟入(附代码)
- OA办公自动化系统页面模版需求帮助
- jsp和js传值的问题
- 用会话返回实体的异常
- 用GWT开发Web界面,请问怎么给TextArea加水平滚动条
- 求助:第一个EJB程序
- getHibernateTemplate().save(user)无法执行,帮忙看看啊
- 一个子类重写的问题?
- 关于在EJB2.0中的select方法的使用问题
- 我的javamail单独类可发,但在servlet/jsp中却不行,晕了两天。有代码。请教。
- 求助:jre不是内部或外部命令,也不是可运行的程序或批处理文件!!!
- 关于jndiobjectfactorybean 的问题
你只是要个统计数字 不需要返回数据对象么
select 子句选择将哪些对象与属性返 回到查询结果集中. 考虑如下情况: select mate
from Cat as cat
inner join cat.mate as mate
该语句将选择mates of other Cats。(其他猫的配偶) 实际上, 你可以更简洁的用以下的查询语句表达相同的含义: select cat.mate from Cat cat
查询语句可以返回值为任何类型的属性,包括返回类型为某种组件(Component)的属性: select cat.name from DomesticCat cat
where cat.name like 'fri%'
select cust.name.firstName from Customer as cust
查询语句可以返回多个对象和(或)属性,存放在 Object[]队列中, select mother, offspr, mate.name
from DomesticCat as mother
inner join mother.mate as mate
left outer join mother.kittens as offspr
或存放在一个List对象中, select new list(mother, offspr, mate.name)
from DomesticCat as mother
inner join mother.mate as mate
left outer join mother.kittens as offspr
也可能直接返回一个实际的类型安全的Java对象, select new Family(mother, mate, offspr)
from DomesticCat as mother
join mother.mate as mate
left join mother.kittens as offspr
假设类Family有一个合适的构造函数. 你可以使用关键字as给“被选择了的表达式”指派别名: select max(bodyWeight) as max, min(bodyWeight) as min, count(*) as n
from Cat cat
这种做法在与子句select new map一起使用时最有用: select new map( max(bodyWeight) as max, min(bodyWeight) as min, count(*) as n )
from Cat cat
该查询返回了一个Map的对象,内容是别名与被选择的值组成的名-值映射。
select count(*) from (select new RelevanceVide(r.resId,r.title,v.duration,v.bitrate,v.videoCodec,v.audioCodec) from Resource r,ResVideo v where r.resId = v.resId) as rv
select * from (select...)