作者tn801534 ()
看板Database
标题Re: [SQL ] ACCESS里的一些
时间Sun Nov 4 09:25:50 2007
先谢过bc大大
※ 引述《bcse (Lvx ex Caelis)》之铭言:
: ※ 引述《tn801534 ()》之铭言:
: : ACCESS好像不接受
: : count(distinct 姓名) 这样的语法
: distinct 放在 count 里面?
: 你是想要这个吗?
: select count(*) from table group by 姓名
: 还是这个?
: select count(*)
: from (
: select distinct 姓名
: from table
: ) as table2
: : 还有
喔喔原来可以这样用了了
select 公司,count(distinct 产品)
from table
group by 公司
这段之前打错OTZ
: : 这个好像也不能接受
: : 他distinct好像只能直接在select後面
: 看不懂你希望他输出什麽…
: group by 公司的话,一间公司就只有一笔资料
: 产品是不是 distinct 根本没意义
: 不知道的你想要的是不是这个?
: select 公司, 产品
: from table
: group by 公司, 产品
: : 还有要限制输出几笔的limit
: : 像
: : select *
: : from table
: : limit 5
: : 这些语法在access要怎麽实作呢?
: 好像有这样的语法…
select top 5 *
from table
top语法我在说明文件找到了 原来如此
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.211.217.211
※ 编辑: tn801534 来自: 218.211.217.211 (11/04 09:30)
※ 编辑: tn801534 来自: 218.211.217.211 (11/04 09:30)