|
本帖最后由 todaynew 于 2011-3-23 10:37 编辑
huanglucy 发表于 2011-3-23 10:08
SELECT a.姓名, count(*) AS 电视机名次
FROM 销售 AS a INNER JOIN [select distinct 电视机 from 销售]. ...
SELECT *,DCount("*","销售","冰箱>=" & [冰箱]) AS 冰箱名次, DCount("*","销售","电视机>=" & [电视机]) AS 电视机名次
FROM 销售
ORDER BY DCount("*","销售","冰箱>=" & [冰箱]);
或者:
SELECT a.*,(select Count(b.*) from 销售 as b where b.冰箱>=a.冰箱) AS 冰箱名次, (select Count(c.*) from 销售 as c where c.电视机>=a.电视机) AS 电视机名次
FROM 销售 as a
ORDER BY (select Count(b.*) from 销售 as b where b.冰箱>=a.冰箱);
|
|