P
puremoonstone
Unregistered / Unconfirmed
GUEST, unregistred user!
sql中关于compute,compute by的问题:
如下SQL语句
use pubs
select type,price from titles where type like '%cook%'
order by type compute sum(price)
的执行结果是:
type price
------------ ---------------------
mod_cook 19.9900
mod_cook 2.9900
trad_cook 20.9500
trad_cook 11.9500
trad_cook 14.9900
sum
===================
70.8700
我在一个adoquery中也是这样写的sql语句,但在相应的grid中却只显示了
type price
------------ ---------------------
mod_cook 19.9900
mod_cook 2.9900
同时也只打印成这样,请问是怎么回事呢?
同样的,我的
use pubs
select type,price from titles where type like '%cook%'
order by type compute sum(price) by type
的执行结果如下
type price
------------ ---------------------
mod_cook 19.9900
mod_cook 2.9900
sum
===================
22.9800
trad_cook 20.9500
trad_cook 11.9500
trad_cook 14.9900
sum
===================
47.8900
也不能正确显示和打印,该怎么办呢?
再请问roll up 和cube 中的统计数据该怎样有效读取呢?
如下SQL语句
use pubs
select type,price from titles where type like '%cook%'
order by type compute sum(price)
的执行结果是:
type price
------------ ---------------------
mod_cook 19.9900
mod_cook 2.9900
trad_cook 20.9500
trad_cook 11.9500
trad_cook 14.9900
sum
===================
70.8700
我在一个adoquery中也是这样写的sql语句,但在相应的grid中却只显示了
type price
------------ ---------------------
mod_cook 19.9900
mod_cook 2.9900
同时也只打印成这样,请问是怎么回事呢?
同样的,我的
use pubs
select type,price from titles where type like '%cook%'
order by type compute sum(price) by type
的执行结果如下
type price
------------ ---------------------
mod_cook 19.9900
mod_cook 2.9900
sum
===================
22.9800
trad_cook 20.9500
trad_cook 11.9500
trad_cook 14.9900
sum
===================
47.8900
也不能正确显示和打印,该怎么办呢?
再请问roll up 和cube 中的统计数据该怎样有效读取呢?